mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 10:21:04 +01:00
Update tuple tests, and merge in expr-category (#5549)
In the vein of https://github.com/carbon-language/carbon-lang/pull/5455. This merges the one expr_category test into tuple testing because it seemed closely associated (particularly with in_place_tuple_init.carbon), and it didn't seem worth keeping a directory for a single test. Note the entire "access" directory is combined into element_access.carbon.
This commit is contained in:
@@ -1,141 +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/expr_category/in_place_tuple_init.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/expr_category/in_place_tuple_init.carbon
|
||||
|
||||
fn F() -> (i32, i32);
|
||||
|
||||
fn G() -> (i32, i32) {
|
||||
var v: (i32, i32) = F();
|
||||
v = F();
|
||||
return F();
|
||||
}
|
||||
|
||||
fn H() -> i32 {
|
||||
return G().0;
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- in_place_tuple_init.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %H.type: type = fn_type @H [concrete]
|
||||
// CHECK:STDOUT: %H: %H.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: .G = %G.decl
|
||||
// CHECK:STDOUT: .H = %H.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.511 = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.511 = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_20.1: %tuple.type.24b = tuple_literal (%i32.loc11_12, %i32.loc11_17)
|
||||
// CHECK:STDOUT: %.loc11_20.2: type = converted %.loc11_20.1, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: %return.param: ref %tuple.type.d07 = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %tuple.type.d07 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.511 = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.511 = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int_32.loc13_12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc13_12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc13_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc13_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc13_20.1: %tuple.type.24b = tuple_literal (%i32.loc13_12, %i32.loc13_17)
|
||||
// CHECK:STDOUT: %.loc13_20.2: type = converted %.loc13_20.1, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: %return.param: ref %tuple.type.d07 = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %tuple.type.d07 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() -> %return.param: %tuple.type.d07;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() -> %return.param: %tuple.type.d07 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: %pattern_type.511 = binding_pattern v [concrete]
|
||||
// CHECK:STDOUT: %v.var_patt: %pattern_type.511 = var_pattern %v.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v.var: ref %tuple.type.d07 = var %v.var_patt
|
||||
// CHECK:STDOUT: %F.ref.loc14: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %.loc14_3: ref %tuple.type.d07 = splice_block %v.var {}
|
||||
// CHECK:STDOUT: %F.call.loc14: init %tuple.type.d07 = call %F.ref.loc14() to %.loc14_3
|
||||
// CHECK:STDOUT: assign %v.var, %F.call.loc14
|
||||
// CHECK:STDOUT: %.loc14_19.1: type = splice_block %.loc14_19.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc14_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc14_19.2: %tuple.type.24b = tuple_literal (%i32.loc14_11, %i32.loc14_16)
|
||||
// CHECK:STDOUT: %.loc14_19.3: type = converted %.loc14_19.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref %tuple.type.d07 = bind_name v, %v.var
|
||||
// CHECK:STDOUT: %v.ref: ref %tuple.type.d07 = name_ref v, %v
|
||||
// CHECK:STDOUT: %F.ref.loc15: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %.loc15: ref %tuple.type.d07 = splice_block %v.ref {}
|
||||
// CHECK:STDOUT: %F.call.loc15: init %tuple.type.d07 = call %F.ref.loc15() to %.loc15
|
||||
// CHECK:STDOUT: assign %v.ref, %F.call.loc15
|
||||
// CHECK:STDOUT: %F.ref.loc16: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %.loc13_8: ref %tuple.type.d07 = splice_block %return {}
|
||||
// CHECK:STDOUT: %F.call.loc16: init %tuple.type.d07 = call %F.ref.loc16() to %.loc13_8
|
||||
// CHECK:STDOUT: return %F.call.loc16 to %return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @H() -> %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
|
||||
// CHECK:STDOUT: %.loc20_12.1: ref %tuple.type.d07 = temporary_storage
|
||||
// CHECK:STDOUT: %G.call: init %tuple.type.d07 = call %G.ref() to %.loc20_12.1
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %.loc20_12.2: ref %tuple.type.d07 = temporary %.loc20_12.1, %G.call
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %.loc20_12.2, element0
|
||||
// CHECK:STDOUT: %.loc20_13: %i32 = bind_value %tuple.elem0
|
||||
// CHECK:STDOUT: return %.loc20_13
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,133 +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/tuple/access/element_access.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/element_access.carbon
|
||||
|
||||
var a: (i32,) = (12,);
|
||||
var b: (i32,) = a;
|
||||
var c: i32 = b.0;
|
||||
|
||||
// CHECK:STDOUT: --- element_access.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.b74: type = pattern_type %tuple.type.a1c [concrete]
|
||||
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.f29: ref %i32 = tuple_access file.%a.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_12.6a3, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_12.6a3, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%int_12.1e1) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.4d5: ref %i32 = tuple_access file.%b.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: .c = %c
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.b74 = binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.b74 = var_pattern %a.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %tuple.type.a1c = var %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc11_13.1: type = splice_block %.loc11_13.3 [concrete = constants.%tuple.type.a1c] {
|
||||
// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_13.2: %tuple.type.85c = tuple_literal (%i32.loc11)
|
||||
// CHECK:STDOUT: %.loc11_13.3: type = converted %.loc11_13.2, constants.%tuple.type.a1c [concrete = constants.%tuple.type.a1c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %tuple.type.a1c = bind_name a, %a.var [concrete = %a.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.b74 = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.b74 = var_pattern %b.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %tuple.type.a1c = var %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc12_13.1: type = splice_block %.loc12_13.3 [concrete = constants.%tuple.type.a1c] {
|
||||
// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc12_13.2: %tuple.type.85c = tuple_literal (%i32.loc12)
|
||||
// CHECK:STDOUT: %.loc12_13.3: type = converted %.loc12_13.2, constants.%tuple.type.a1c [concrete = constants.%tuple.type.a1c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %tuple.type.a1c = bind_name b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.7ce = binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %c.var_patt: %pattern_type.7ce = var_pattern %c.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %i32 = var %c.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc13: type = splice_block %i32.loc13 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var [concrete = %c.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3]
|
||||
// CHECK:STDOUT: %.loc11_21.1: %tuple.type.985 = tuple_literal (%int_12)
|
||||
// CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_21.1: <bound method> = bound_method %int_12, %impl.elem0 [concrete = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_21.2: <bound method> = bound_method %int_12, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_21.2(%int_12) [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %.loc11_21.2: init %i32 = converted %int_12, %int.convert_checked [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %.loc11_21.3: init %tuple.type.a1c = tuple_init (%.loc11_21.2) to file.%a.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_1: init %tuple.type.a1c = converted %.loc11_21.1, %.loc11_21.3 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
|
||||
// CHECK:STDOUT: %a.ref: ref %tuple.type.a1c = name_ref a, file.%a [concrete = file.%a.var]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc12: ref %i32 = tuple_access %a.ref, element0 [concrete = constants.%tuple.elem0.f29]
|
||||
// CHECK:STDOUT: %.loc12_17.1: %i32 = bind_value %tuple.elem0.loc12
|
||||
// CHECK:STDOUT: %.loc12_17.2: init %tuple.type.a1c = tuple_init (%.loc12_17.1) to file.%b.var
|
||||
// CHECK:STDOUT: %.loc12_1: init %tuple.type.a1c = converted %a.ref, %.loc12_17.2
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc12_1
|
||||
// CHECK:STDOUT: %b.ref: ref %tuple.type.a1c = name_ref b, file.%b [concrete = file.%b.var]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc13: ref %i32 = tuple_access %b.ref, element0 [concrete = constants.%tuple.elem0.4d5]
|
||||
// CHECK:STDOUT: %.loc13: %i32 = bind_value %tuple.elem0.loc13
|
||||
// CHECK:STDOUT: assign file.%c.var, %.loc13
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,132 +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/tuple/access/fail_access_error.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_access_error.carbon
|
||||
|
||||
var a: (i32, i32) = (12, 6);
|
||||
// CHECK:STDERR: fail_access_error.carbon:[[@LINE+4]]:17: error: name `oops` not found [NameNotFound]
|
||||
// CHECK:STDERR: var b: i32 = a.(oops);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = a.(oops);
|
||||
|
||||
// CHECK:STDOUT: --- fail_access_error.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete]
|
||||
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.221: <bound method> = bound_method %int_12.6a3, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.dae: <bound method> = bound_method %int_12.6a3, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.ce9: <bound method> = bound_method %int_6.462, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.efa: <bound method> = bound_method %int_6.462, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_12.1e1, %int_6.e56) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: .oops = <poisoned>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.511 = binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.511 = var_pattern %a.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %tuple.type.d07 = var %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc11_17.1: type = splice_block %.loc11_17.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_17.2: %tuple.type.24b = tuple_literal (%i32.loc11_9, %i32.loc11_14)
|
||||
// CHECK:STDOUT: %.loc11_17.3: type = converted %.loc11_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %tuple.type.d07 = bind_name a, %a.var [concrete = %a.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.7ce = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.7ce = var_pattern %b.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc16: type = splice_block %i32.loc16 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3]
|
||||
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6.462]
|
||||
// CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6)
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_27.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_27.1 [concrete = constants.%Convert.bound.221]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_27.1: <specific function> = specific_function %impl.elem0.loc11_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.2: <bound method> = bound_method %int_12, %specific_fn.loc11_27.1 [concrete = constants.%bound_method.dae]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %bound_method.loc11_27.2(%int_12) [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 [concrete = constants.%tuple.elem0]
|
||||
// CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_27.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.3: <bound method> = bound_method %int_6, %impl.elem0.loc11_27.2 [concrete = constants.%Convert.bound.ce9]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_27.2: <specific function> = specific_function %impl.elem0.loc11_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.4: <bound method> = bound_method %int_6, %specific_fn.loc11_27.2 [concrete = constants.%bound_method.efa]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %bound_method.loc11_27.4(%int_6) [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 [concrete = constants.%tuple.elem1]
|
||||
// CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %.loc11_27.6: init %tuple.type.d07 = tuple_init (%.loc11_27.3, %.loc11_27.5) to file.%a.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_1: init %tuple.type.d07 = converted %.loc11_27.1, %.loc11_27.6 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
|
||||
// CHECK:STDOUT: %a.ref: ref %tuple.type.d07 = name_ref a, file.%a [concrete = file.%a.var]
|
||||
// CHECK:STDOUT: %oops.ref: <error> = name_ref oops, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: assign file.%b.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,64 +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/tuple/access/fail_empty_access.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_empty_access.carbon
|
||||
|
||||
fn F() {}
|
||||
|
||||
fn Run() {
|
||||
// CHECK:STDERR: fail_empty_access.carbon:[[@LINE+4]]:3: error: tuple element index `0` is past the end of type `()` [TupleIndexOutOfBounds]
|
||||
// CHECK:STDERR: F().0;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
F().0;
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- fail_empty_access.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Run.type: type = fn_type @Run [concrete]
|
||||
// CHECK:STDOUT: %Run: %Run.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: .Run = %Run.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [concrete = constants.%Run] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Run() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref()
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %.loc18_5.1: ref %empty_tuple.type = temporary_storage
|
||||
// CHECK:STDOUT: %.loc18_5.2: ref %empty_tuple.type = temporary %.loc18_5.1, %F.call
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,154 +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/tuple/access/fail_large_index.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_large_index.carbon
|
||||
|
||||
var a: (i32,) = (12,);
|
||||
var b: (i32,) = a;
|
||||
// CHECK:STDERR: fail_large_index.carbon:[[@LINE+4]]:14: error: tuple element index `1` is past the end of type `(i32,)` [TupleIndexOutOfBounds]
|
||||
// CHECK:STDERR: var c: i32 = b.1;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
var c: i32 = b.1;
|
||||
// CHECK:STDERR: fail_large_index.carbon:[[@LINE+4]]:14: error: tuple element index `2147483647` is past the end of type `(i32,)` [TupleIndexOutOfBounds]
|
||||
// CHECK:STDERR: var d: i32 = b.(0x7FFF_FFFF);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var d: i32 = b.(0x7FFF_FFFF);
|
||||
|
||||
// CHECK:STDOUT: --- fail_large_index.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.b74: type = pattern_type %tuple.type.a1c [concrete]
|
||||
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.f29: ref %i32 = tuple_access file.%a.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_12.6a3, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_12.6a3, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%int_12.1e1) [concrete]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: .c = %c
|
||||
// CHECK:STDOUT: .d = %d
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.b74 = binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.b74 = var_pattern %a.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %tuple.type.a1c = var %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc11_13.1: type = splice_block %.loc11_13.3 [concrete = constants.%tuple.type.a1c] {
|
||||
// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_13.2: %tuple.type.85c = tuple_literal (%i32.loc11)
|
||||
// CHECK:STDOUT: %.loc11_13.3: type = converted %.loc11_13.2, constants.%tuple.type.a1c [concrete = constants.%tuple.type.a1c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %tuple.type.a1c = bind_name a, %a.var [concrete = %a.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.b74 = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.b74 = var_pattern %b.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %tuple.type.a1c = var %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc12_13.1: type = splice_block %.loc12_13.3 [concrete = constants.%tuple.type.a1c] {
|
||||
// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc12_13.2: %tuple.type.85c = tuple_literal (%i32.loc12)
|
||||
// CHECK:STDOUT: %.loc12_13.3: type = converted %.loc12_13.2, constants.%tuple.type.a1c [concrete = constants.%tuple.type.a1c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %tuple.type.a1c = bind_name b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.7ce = binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %c.var_patt: %pattern_type.7ce = var_pattern %c.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %i32 = var %c.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc17: type = splice_block %i32.loc17 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var [concrete = %c.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %d.patt: %pattern_type.7ce = binding_pattern d [concrete]
|
||||
// CHECK:STDOUT: %d.var_patt: %pattern_type.7ce = var_pattern %d.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d.var: ref %i32 = var %d.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc22: type = splice_block %i32.loc22 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var [concrete = %d.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3]
|
||||
// CHECK:STDOUT: %.loc11_21.1: %tuple.type.985 = tuple_literal (%int_12)
|
||||
// CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_21.1: <bound method> = bound_method %int_12, %impl.elem0 [concrete = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_21.2: <bound method> = bound_method %int_12, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_21.2(%int_12) [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %.loc11_21.2: init %i32 = converted %int_12, %int.convert_checked [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %.loc11_21.3: init %tuple.type.a1c = tuple_init (%.loc11_21.2) to file.%a.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_1: init %tuple.type.a1c = converted %.loc11_21.1, %.loc11_21.3 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
|
||||
// CHECK:STDOUT: %a.ref: ref %tuple.type.a1c = name_ref a, file.%a [concrete = file.%a.var]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %a.ref, element0 [concrete = constants.%tuple.elem0.f29]
|
||||
// CHECK:STDOUT: %.loc12_17.1: %i32 = bind_value %tuple.elem0
|
||||
// CHECK:STDOUT: %.loc12_17.2: init %tuple.type.a1c = tuple_init (%.loc12_17.1) to file.%b.var
|
||||
// CHECK:STDOUT: %.loc12_1: init %tuple.type.a1c = converted %a.ref, %.loc12_17.2
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc12_1
|
||||
// CHECK:STDOUT: %b.ref.loc17: ref %tuple.type.a1c = name_ref b, file.%b [concrete = file.%b.var]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: assign file.%c.var, <error>
|
||||
// CHECK:STDOUT: %b.ref.loc22: ref %tuple.type.a1c = name_ref b, file.%b [concrete = file.%b.var]
|
||||
// CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [concrete = constants.%int_2147483647]
|
||||
// CHECK:STDOUT: assign file.%d.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,150 +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/tuple/access/fail_negative_indexing.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon
|
||||
|
||||
var a: (i32, i32) = (12, 6);
|
||||
// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+4]]:14: error: tuple element index `-10` is past the end of type `(i32, i32)` [TupleIndexOutOfBounds]
|
||||
// CHECK:STDERR: var b: i32 = a.(-10);
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = a.(-10);
|
||||
|
||||
// CHECK:STDOUT: --- fail_negative_indexing.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete]
|
||||
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.221: <bound method> = bound_method %int_12.6a3, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.dae: <bound method> = bound_method %int_12.6a3, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.ce9: <bound method> = bound_method %int_6.462, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.efa: <bound method> = bound_method %int_6.462, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_12.1e1, %int_6.e56) [concrete]
|
||||
// CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [concrete]
|
||||
// CHECK:STDOUT: %Op.type.e42: type = fn_type @Op.23 [concrete]
|
||||
// CHECK:STDOUT: %Negate.impl_witness.561: <witness> = impl_witness imports.%Negate.impl_witness_table.e09 [concrete]
|
||||
// CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value Core.IntLiteral, (%Negate.impl_witness.561) [concrete]
|
||||
// CHECK:STDOUT: %.63a: type = fn_type_with_self_type %Op.type.e42, %Negate.facet [concrete]
|
||||
// CHECK:STDOUT: %Op.type.1be: type = fn_type @Op.24 [concrete]
|
||||
// CHECK:STDOUT: %Op.bba: %Op.type.1be = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Op.bound: <bound method> = bound_method %int_10, %Op.bba [concrete]
|
||||
// CHECK:STDOUT: %int_-10: Core.IntLiteral = int_value -10 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: .Negate = %Core.Negate
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/operators/arithmetic, Negate, loaded [concrete = constants.%Negate.type]
|
||||
// CHECK:STDOUT: %Core.import_ref.c15: %Op.type.1be = import_ref Core//prelude/operators/arithmetic, loc94_31, loaded [concrete = constants.%Op.bba]
|
||||
// CHECK:STDOUT: %Negate.impl_witness_table.e09 = impl_witness_table (%Core.import_ref.c15), @impl.8cb [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.511 = binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.511 = var_pattern %a.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %tuple.type.d07 = var %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc11_17.1: type = splice_block %.loc11_17.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_17.2: %tuple.type.24b = tuple_literal (%i32.loc11_9, %i32.loc11_14)
|
||||
// CHECK:STDOUT: %.loc11_17.3: type = converted %.loc11_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %tuple.type.d07 = bind_name a, %a.var [concrete = %a.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.7ce = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.7ce = var_pattern %b.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc16: type = splice_block %i32.loc16 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3]
|
||||
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6.462]
|
||||
// CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6)
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_27.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_27.1 [concrete = constants.%Convert.bound.221]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_27.1: <specific function> = specific_function %impl.elem0.loc11_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.2: <bound method> = bound_method %int_12, %specific_fn.loc11_27.1 [concrete = constants.%bound_method.dae]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %bound_method.loc11_27.2(%int_12) [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 [concrete = constants.%tuple.elem0]
|
||||
// CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_27.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.3: <bound method> = bound_method %int_6, %impl.elem0.loc11_27.2 [concrete = constants.%Convert.bound.ce9]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_27.2: <specific function> = specific_function %impl.elem0.loc11_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.4: <bound method> = bound_method %int_6, %specific_fn.loc11_27.2 [concrete = constants.%bound_method.efa]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %bound_method.loc11_27.4(%int_6) [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 [concrete = constants.%tuple.elem1]
|
||||
// CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %.loc11_27.6: init %tuple.type.d07 = tuple_init (%.loc11_27.3, %.loc11_27.5) to file.%a.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_1: init %tuple.type.d07 = converted %.loc11_27.1, %.loc11_27.6 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
|
||||
// CHECK:STDOUT: %a.ref: ref %tuple.type.d07 = name_ref a, file.%a [concrete = file.%a.var]
|
||||
// CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [concrete = constants.%int_10]
|
||||
// CHECK:STDOUT: %impl.elem0.loc16: %.63a = impl_witness_access constants.%Negate.impl_witness.561, element0 [concrete = constants.%Op.bba]
|
||||
// CHECK:STDOUT: %bound_method.loc16: <bound method> = bound_method %int_10, %impl.elem0.loc16 [concrete = constants.%Op.bound]
|
||||
// CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %bound_method.loc16(%int_10) [concrete = constants.%int_-10]
|
||||
// CHECK:STDOUT: %.loc16_17.1: Core.IntLiteral = value_of_initializer %int.snegate [concrete = constants.%int_-10]
|
||||
// CHECK:STDOUT: %.loc16_17.2: Core.IntLiteral = converted %int.snegate, %.loc16_17.1 [concrete = constants.%int_-10]
|
||||
// CHECK:STDOUT: assign file.%b.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,155 +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/tuple/access/fail_non_deterministic_type.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon
|
||||
|
||||
var a: (i32, i32) = (2, 3);
|
||||
var b: Core.IntLiteral() = 0;
|
||||
// CHECK:STDERR: fail_non_deterministic_type.carbon:[[@LINE+4]]:14: error: tuple index must be a constant [TupleIndexNotConstant]
|
||||
// CHECK:STDERR: var c: i32 = a.(b);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
var c: i32 = a.(b);
|
||||
|
||||
// CHECK:STDOUT: --- fail_non_deterministic_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.b92: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.b30: <bound method> = bound_method %int_3.1ba, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.047: <bound method> = bound_method %int_3.1ba, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_2.ef8, %int_3.822) [concrete]
|
||||
// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
|
||||
// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: .c = %c
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.511 = binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.511 = var_pattern %a.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %tuple.type.d07 = var %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc11_17.1: type = splice_block %.loc11_17.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_17.2: %tuple.type.24b = tuple_literal (%i32.loc11_9, %i32.loc11_14)
|
||||
// CHECK:STDOUT: %.loc11_17.3: type = converted %.loc11_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %tuple.type.d07 = bind_name a, %a.var [concrete = %a.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.dc0 = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.dc0 = var_pattern %b.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref Core.IntLiteral = var %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc12_24.1: type = splice_block %.loc12_24.3 [concrete = Core.IntLiteral] {
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
|
||||
// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %.loc12_24.2: type = value_of_initializer %int_literal.make_type [concrete = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %.loc12_24.3: type = converted %int_literal.make_type, %.loc12_24.2 [concrete = Core.IntLiteral]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref Core.IntLiteral = bind_name b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.7ce = binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %c.var_patt: %pattern_type.7ce = var_pattern %c.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %i32 = var %c.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc17: type = splice_block %i32.loc17 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var [concrete = %c.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc11_26.1: %tuple.type.f94 = tuple_literal (%int_2, %int_3)
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_26.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_26.1: <bound method> = bound_method %int_2, %impl.elem0.loc11_26.1 [concrete = constants.%Convert.bound.ef9]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_26.1: <specific function> = specific_function %impl.elem0.loc11_26.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_26.2: <bound method> = bound_method %int_2, %specific_fn.loc11_26.1 [concrete = constants.%bound_method.b92]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_26.1: init %i32 = call %bound_method.loc11_26.2(%int_2) [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc11_26.2: init %i32 = converted %int_2, %int.convert_checked.loc11_26.1 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 [concrete = constants.%tuple.elem0]
|
||||
// CHECK:STDOUT: %.loc11_26.3: init %i32 = initialize_from %.loc11_26.2 to %tuple.elem0 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_26.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_26.3: <bound method> = bound_method %int_3, %impl.elem0.loc11_26.2 [concrete = constants.%Convert.bound.b30]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_26.2: <specific function> = specific_function %impl.elem0.loc11_26.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_26.4: <bound method> = bound_method %int_3, %specific_fn.loc11_26.2 [concrete = constants.%bound_method.047]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_26.2: init %i32 = call %bound_method.loc11_26.4(%int_3) [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc11_26.4: init %i32 = converted %int_3, %int.convert_checked.loc11_26.2 [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 [concrete = constants.%tuple.elem1]
|
||||
// CHECK:STDOUT: %.loc11_26.5: init %i32 = initialize_from %.loc11_26.4 to %tuple.elem1 [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc11_26.6: init %tuple.type.d07 = tuple_init (%.loc11_26.3, %.loc11_26.5) to file.%a.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_1: init %tuple.type.d07 = converted %.loc11_26.1, %.loc11_26.6 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: assign file.%b.var, %int_0
|
||||
// CHECK:STDOUT: %a.ref: ref %tuple.type.d07 = name_ref a, file.%a [concrete = file.%a.var]
|
||||
// CHECK:STDOUT: %b.ref: ref Core.IntLiteral = name_ref b, file.%b [concrete = file.%b.var]
|
||||
// CHECK:STDOUT: %.loc17: Core.IntLiteral = bind_value %b.ref
|
||||
// CHECK:STDOUT: assign file.%c.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,136 +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/tuple/access/fail_non_int_indexing.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon
|
||||
|
||||
var a: (i32, i32) = (12, 6);
|
||||
// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+7]]:17: error: cannot implicitly convert expression of type `f64` to `Core.IntLiteral` [ConversionFailure]
|
||||
// CHECK:STDERR: var b: i32 = a.(2.6);
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+4]]:17: note: type `f64` does not implement interface `Core.ImplicitAs(Core.IntLiteral)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: var b: i32 = a.(2.6);
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = a.(2.6);
|
||||
|
||||
// CHECK:STDOUT: --- fail_non_int_indexing.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete]
|
||||
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.221: <bound method> = bound_method %int_12.6a3, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.dae: <bound method> = bound_method %int_12.6a3, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.ce9: <bound method> = bound_method %int_6.462, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.efa: <bound method> = bound_method %int_6.462, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_12.1e1, %int_6.e56) [concrete]
|
||||
// CHECK:STDOUT: %float: f64 = float_literal 2.6000000000000001 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.511 = binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.511 = var_pattern %a.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %tuple.type.d07 = var %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc11_17.1: type = splice_block %.loc11_17.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_17.2: %tuple.type.24b = tuple_literal (%i32.loc11_9, %i32.loc11_14)
|
||||
// CHECK:STDOUT: %.loc11_17.3: type = converted %.loc11_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %tuple.type.d07 = bind_name a, %a.var [concrete = %a.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.7ce = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.7ce = var_pattern %b.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc19: type = splice_block %i32.loc19 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3]
|
||||
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6.462]
|
||||
// CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6)
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_27.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_27.1 [concrete = constants.%Convert.bound.221]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_27.1: <specific function> = specific_function %impl.elem0.loc11_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.2: <bound method> = bound_method %int_12, %specific_fn.loc11_27.1 [concrete = constants.%bound_method.dae]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %bound_method.loc11_27.2(%int_12) [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 [concrete = constants.%tuple.elem0]
|
||||
// CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_27.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.3: <bound method> = bound_method %int_6, %impl.elem0.loc11_27.2 [concrete = constants.%Convert.bound.ce9]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_27.2: <specific function> = specific_function %impl.elem0.loc11_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.4: <bound method> = bound_method %int_6, %specific_fn.loc11_27.2 [concrete = constants.%bound_method.efa]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %bound_method.loc11_27.4(%int_6) [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 [concrete = constants.%tuple.elem1]
|
||||
// CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %.loc11_27.6: init %tuple.type.d07 = tuple_init (%.loc11_27.3, %.loc11_27.5) to file.%a.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_1: init %tuple.type.d07 = converted %.loc11_27.1, %.loc11_27.6 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
|
||||
// CHECK:STDOUT: %a.ref: ref %tuple.type.d07 = name_ref a, file.%a [concrete = file.%a.var]
|
||||
// CHECK:STDOUT: %float: f64 = float_literal 2.6000000000000001 [concrete = constants.%float]
|
||||
// CHECK:STDOUT: %.loc19: Core.IntLiteral = converted %float, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: assign file.%b.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,143 +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/tuple/access/fail_non_tuple_access.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon
|
||||
|
||||
fn Main() {
|
||||
// CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+4]]:3: error: type `Core.IntLiteral` does not support indexing [TypeNotIndexable]
|
||||
// CHECK:STDERR: 0[1];
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
0[1];
|
||||
|
||||
var non_tuple: array(i32, 2) = (5, 5);
|
||||
// CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+4]]:20: error: type `array(i32, 2)` does not support tuple indexing; only tuples can be indexed that way [TupleIndexOnANonTupleType]
|
||||
// CHECK:STDERR: var first: i32 = non_tuple.0;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var first: i32 = non_tuple.0;
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- fail_non_tuple_access.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Main.type: type = fn_type @Main [concrete]
|
||||
// CHECK:STDOUT: %Main: %Main.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %IndexWith.type.504: type = generic_interface_type @IndexWith [concrete]
|
||||
// CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.504 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_2, %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.ae7: type = pattern_type %array_type [concrete]
|
||||
// CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_5.64b, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_5.64b, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete]
|
||||
// CHECK:STDOUT: %array: %array_type = tuple_value (%int_5.0f6, %int_5.0f6) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .IndexWith = %Core.IndexWith
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//prelude/operators/index, IndexWith, loaded [concrete = constants.%IndexWith.generic]
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .Main = %Main.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [concrete = constants.%Main] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Main() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_0.loc16: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %int_1.loc16: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %non_tuple.patt: %pattern_type.ae7 = binding_pattern non_tuple [concrete]
|
||||
// CHECK:STDOUT: %non_tuple.var_patt: %pattern_type.ae7 = var_pattern %non_tuple.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %non_tuple.var: ref %array_type = var %non_tuple.var_patt
|
||||
// CHECK:STDOUT: %int_5.loc18_35: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b]
|
||||
// CHECK:STDOUT: %int_5.loc18_38: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b]
|
||||
// CHECK:STDOUT: %.loc18_39.1: %tuple.type = tuple_literal (%int_5.loc18_35, %int_5.loc18_38)
|
||||
// CHECK:STDOUT: %impl.elem0.loc18_39.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc18_39.1: <bound method> = bound_method %int_5.loc18_35, %impl.elem0.loc18_39.1 [concrete = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc18_39.1: <specific function> = specific_function %impl.elem0.loc18_39.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc18_39.2: <bound method> = bound_method %int_5.loc18_35, %specific_fn.loc18_39.1 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc18_39.1: init %i32 = call %bound_method.loc18_39.2(%int_5.loc18_35) [concrete = constants.%int_5.0f6]
|
||||
// CHECK:STDOUT: %.loc18_39.2: init %i32 = converted %int_5.loc18_35, %int.convert_checked.loc18_39.1 [concrete = constants.%int_5.0f6]
|
||||
// CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %.loc18_39.3: ref %i32 = array_index %non_tuple.var, %int_0.loc18
|
||||
// CHECK:STDOUT: %.loc18_39.4: init %i32 = initialize_from %.loc18_39.2 to %.loc18_39.3 [concrete = constants.%int_5.0f6]
|
||||
// CHECK:STDOUT: %impl.elem0.loc18_39.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc18_39.3: <bound method> = bound_method %int_5.loc18_38, %impl.elem0.loc18_39.2 [concrete = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc18_39.2: <specific function> = specific_function %impl.elem0.loc18_39.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc18_39.4: <bound method> = bound_method %int_5.loc18_38, %specific_fn.loc18_39.2 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc18_39.2: init %i32 = call %bound_method.loc18_39.4(%int_5.loc18_38) [concrete = constants.%int_5.0f6]
|
||||
// CHECK:STDOUT: %.loc18_39.5: init %i32 = converted %int_5.loc18_38, %int.convert_checked.loc18_39.2 [concrete = constants.%int_5.0f6]
|
||||
// CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc18_39.6: ref %i32 = array_index %non_tuple.var, %int_1.loc18
|
||||
// CHECK:STDOUT: %.loc18_39.7: init %i32 = initialize_from %.loc18_39.5 to %.loc18_39.6 [concrete = constants.%int_5.0f6]
|
||||
// CHECK:STDOUT: %.loc18_39.8: init %array_type = array_init (%.loc18_39.4, %.loc18_39.7) to %non_tuple.var [concrete = constants.%array]
|
||||
// CHECK:STDOUT: %.loc18_3: init %array_type = converted %.loc18_39.1, %.loc18_39.8 [concrete = constants.%array]
|
||||
// CHECK:STDOUT: assign %non_tuple.var, %.loc18_3
|
||||
// CHECK:STDOUT: %.loc18_30: type = splice_block %array_type [concrete = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_2, %i32.loc18 [concrete = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %non_tuple: ref %array_type = bind_name non_tuple, %non_tuple.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %first.patt: %pattern_type.7ce = binding_pattern first [concrete]
|
||||
// CHECK:STDOUT: %first.var_patt: %pattern_type.7ce = var_pattern %first.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %first.var: ref %i32 = var %first.var_patt
|
||||
// CHECK:STDOUT: %non_tuple.ref: ref %array_type = name_ref non_tuple, %non_tuple
|
||||
// CHECK:STDOUT: %int_0.loc23: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: assign %first.var, <error>
|
||||
// CHECK:STDOUT: %.loc23: type = splice_block %i32.loc23 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %first: ref %i32 = bind_name first, %first.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,132 +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/tuple/access/fail_out_of_bound_access.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon
|
||||
|
||||
var a: (i32, i32) = (12, 6);
|
||||
// CHECK:STDERR: fail_out_of_bound_access.carbon:[[@LINE+4]]:14: error: tuple element index `2` is past the end of type `(i32, i32)` [TupleIndexOutOfBounds]
|
||||
// CHECK:STDERR: var b: i32 = a.2;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = a.2;
|
||||
|
||||
// CHECK:STDOUT: --- fail_out_of_bound_access.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete]
|
||||
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.221: <bound method> = bound_method %int_12.6a3, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.dae: <bound method> = bound_method %int_12.6a3, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.ce9: <bound method> = bound_method %int_6.462, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.efa: <bound method> = bound_method %int_6.462, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_12.1e1, %int_6.e56) [concrete]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.511 = binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.511 = var_pattern %a.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %tuple.type.d07 = var %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc11_17.1: type = splice_block %.loc11_17.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_17.2: %tuple.type.24b = tuple_literal (%i32.loc11_9, %i32.loc11_14)
|
||||
// CHECK:STDOUT: %.loc11_17.3: type = converted %.loc11_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %tuple.type.d07 = bind_name a, %a.var [concrete = %a.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.7ce = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.7ce = var_pattern %b.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc16: type = splice_block %i32.loc16 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3]
|
||||
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6.462]
|
||||
// CHECK:STDOUT: %.loc11_27.1: %tuple.type.f94 = tuple_literal (%int_12, %int_6)
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_27.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_27.1 [concrete = constants.%Convert.bound.221]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_27.1: <specific function> = specific_function %impl.elem0.loc11_27.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.2: <bound method> = bound_method %int_12, %specific_fn.loc11_27.1 [concrete = constants.%bound_method.dae]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_27.1: init %i32 = call %bound_method.loc11_27.2(%int_12) [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_12, %int.convert_checked.loc11_27.1 [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 [concrete = constants.%tuple.elem0]
|
||||
// CHECK:STDOUT: %.loc11_27.3: init %i32 = initialize_from %.loc11_27.2 to %tuple.elem0 [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_27.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.3: <bound method> = bound_method %int_6, %impl.elem0.loc11_27.2 [concrete = constants.%Convert.bound.ce9]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_27.2: <specific function> = specific_function %impl.elem0.loc11_27.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_27.4: <bound method> = bound_method %int_6, %specific_fn.loc11_27.2 [concrete = constants.%bound_method.efa]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_27.2: init %i32 = call %bound_method.loc11_27.4(%int_6) [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %.loc11_27.4: init %i32 = converted %int_6, %int.convert_checked.loc11_27.2 [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 [concrete = constants.%tuple.elem1]
|
||||
// CHECK:STDOUT: %.loc11_27.5: init %i32 = initialize_from %.loc11_27.4 to %tuple.elem1 [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %.loc11_27.6: init %tuple.type.d07 = tuple_init (%.loc11_27.3, %.loc11_27.5) to file.%a.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_1: init %tuple.type.d07 = converted %.loc11_27.1, %.loc11_27.6 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
|
||||
// CHECK:STDOUT: %a.ref: ref %tuple.type.d07 = name_ref a, file.%a [concrete = file.%a.var]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: assign file.%b.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,138 +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/tuple/access/fail_out_of_bound_not_literal.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon
|
||||
|
||||
var a: (i32, i32) = (12, 34);
|
||||
// CHECK:STDERR: fail_out_of_bound_not_literal.carbon:[[@LINE+4]]:14: error: tuple element index `2` is past the end of type `(i32, i32)` [TupleIndexOutOfBounds]
|
||||
// CHECK:STDERR: var b: i32 = a.({.index = 2}.index);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = a.({.index = 2}.index);
|
||||
|
||||
// CHECK:STDOUT: --- fail_out_of_bound_not_literal.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete]
|
||||
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %int_34.3f9: Core.IntLiteral = int_value 34 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.221: <bound method> = bound_method %int_12.6a3, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.dae: <bound method> = bound_method %int_12.6a3, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.82c: <bound method> = bound_method %int_34.3f9, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.34d: <bound method> = bound_method %int_34.3f9, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_34.980: %i32 = int_value 34 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_12.1e1, %int_34.980) [concrete]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.index: type = struct_type {.index: Core.IntLiteral} [concrete]
|
||||
// CHECK:STDOUT: %struct: %struct_type.index = struct_value (%int_2) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.511 = binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.511 = var_pattern %a.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %tuple.type.d07 = var %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc11_17.1: type = splice_block %.loc11_17.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_17.2: %tuple.type.24b = tuple_literal (%i32.loc11_9, %i32.loc11_14)
|
||||
// CHECK:STDOUT: %.loc11_17.3: type = converted %.loc11_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %tuple.type.d07 = bind_name a, %a.var [concrete = %a.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.7ce = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.7ce = var_pattern %b.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc16: type = splice_block %i32.loc16 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3]
|
||||
// CHECK:STDOUT: %int_34: Core.IntLiteral = int_value 34 [concrete = constants.%int_34.3f9]
|
||||
// CHECK:STDOUT: %.loc11_28.1: %tuple.type.f94 = tuple_literal (%int_12, %int_34)
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_28.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_28.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_28.1 [concrete = constants.%Convert.bound.221]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_28.1: <specific function> = specific_function %impl.elem0.loc11_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_28.2: <bound method> = bound_method %int_12, %specific_fn.loc11_28.1 [concrete = constants.%bound_method.dae]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %bound_method.loc11_28.2(%int_12) [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %.loc11_28.2: init %i32 = converted %int_12, %int.convert_checked.loc11_28.1 [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%a.var, element0 [concrete = constants.%tuple.elem0]
|
||||
// CHECK:STDOUT: %.loc11_28.3: init %i32 = initialize_from %.loc11_28.2 to %tuple.elem0 [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_28.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_28.3: <bound method> = bound_method %int_34, %impl.elem0.loc11_28.2 [concrete = constants.%Convert.bound.82c]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_28.2: <specific function> = specific_function %impl.elem0.loc11_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_28.4: <bound method> = bound_method %int_34, %specific_fn.loc11_28.2 [concrete = constants.%bound_method.34d]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %bound_method.loc11_28.4(%int_34) [concrete = constants.%int_34.980]
|
||||
// CHECK:STDOUT: %.loc11_28.4: init %i32 = converted %int_34, %int.convert_checked.loc11_28.2 [concrete = constants.%int_34.980]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 [concrete = constants.%tuple.elem1]
|
||||
// CHECK:STDOUT: %.loc11_28.5: init %i32 = initialize_from %.loc11_28.4 to %tuple.elem1 [concrete = constants.%int_34.980]
|
||||
// CHECK:STDOUT: %.loc11_28.6: init %tuple.type.d07 = tuple_init (%.loc11_28.3, %.loc11_28.5) to file.%a.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_1: init %tuple.type.d07 = converted %.loc11_28.1, %.loc11_28.6 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
|
||||
// CHECK:STDOUT: %a.ref: ref %tuple.type.d07 = name_ref a, file.%a [concrete = file.%a.var]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc16_28.1: %struct_type.index = struct_literal (%int_2)
|
||||
// CHECK:STDOUT: %struct: %struct_type.index = struct_value (%int_2) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc16_28.2: %struct_type.index = converted %.loc16_28.1, %struct [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc16_29: Core.IntLiteral = struct_access %.loc16_28.2, element0 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: assign file.%b.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,246 +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/tuple/access/index_not_literal.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/index_not_literal.carbon
|
||||
|
||||
var a: (bool, i32) = (true, 34);
|
||||
var b: i32 = a.({.index = 1}.index);
|
||||
var c: bool = a.(0 as i32);
|
||||
var d: i32 = a.({.index = 1 as i32}.index);
|
||||
|
||||
// CHECK:STDOUT: --- index_not_literal.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
|
||||
// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.261: type = tuple_type (bool, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.f98: type = pattern_type %tuple.type.261 [concrete]
|
||||
// CHECK:STDOUT: %true: bool = bool_literal true [concrete]
|
||||
// CHECK:STDOUT: %int_34.3f9: Core.IntLiteral = int_value 34 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.3c2: type = tuple_type (bool, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref bool = tuple_access file.%a.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
|
||||
// CHECK:STDOUT: %From: Core.IntLiteral = bind_symbolic_name From, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.708: type = fn_type @Convert.3, @impl.971(%From) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.c68: %Convert.type.708 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
|
||||
// CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.062: type = fn_type @Convert.5, @impl.686(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.527: %Convert.type.062 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.82c: <bound method> = bound_method %int_34.3f9, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.b6f: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.34d: <bound method> = bound_method %int_34.3f9, %Convert.specific_fn.b6f [concrete]
|
||||
// CHECK:STDOUT: %int_34.980: %i32 = int_value 34 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.261 = tuple_value (%true, %int_34.980) [concrete]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.index.b1b: type = struct_type {.index: Core.IntLiteral} [concrete]
|
||||
// CHECK:STDOUT: %struct.972: %struct_type.index.b1b = struct_value (%int_1.5b8) [concrete]
|
||||
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: %As.type.fd4: type = facet_type <@As, @As(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.4, @As(%i32) [concrete]
|
||||
// CHECK:STDOUT: %As.impl_witness.6b4: <witness> = impl_witness imports.%As.impl_witness_table.eb4, @impl.686(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.686(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, (%As.impl_witness.6b4) [concrete]
|
||||
// CHECK:STDOUT: %.982: type = fn_type_with_self_type %Convert.type.99b, %As.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.129: <bound method> = bound_method %int_0.5c6, %Convert.197 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.aad: <specific function> = specific_function %Convert.197, @Convert.5(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.46b: <bound method> = bound_method %int_0.5c6, %Convert.specific_fn.aad [concrete]
|
||||
// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.a11: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.1d9, @impl.971(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.971(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet.f49: %ImplicitAs.type.2fd = facet_value %i32, (%ImplicitAs.impl_witness.a11) [concrete]
|
||||
// CHECK:STDOUT: %.0ea: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.f49 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.0fd: <bound method> = bound_method %int_0.6a9, %Convert.960 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.8a8: <specific function> = specific_function %Convert.960, @Convert.3(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.4b5: <bound method> = bound_method %int_0.6a9, %Convert.specific_fn.8a8 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.c1b: <bound method> = bound_method %int_1.5b8, %Convert.197 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.082: <bound method> = bound_method %int_1.5b8, %Convert.specific_fn.aad [concrete]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.index.6ea: type = struct_type {.index: %i32} [concrete]
|
||||
// CHECK:STDOUT: %struct.63a: %struct_type.index.6ea = struct_value (%int_1.5d2) [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.faf: <bound method> = bound_method %int_1.5d2, %Convert.960 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.711: <bound method> = bound_method %int_1.5d2, %Convert.specific_fn.8a8 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Bool = %Core.Bool
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: .As = %Core.As
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: %Core.import_ref.85c: @impl.971.%Convert.type (%Convert.type.708) = import_ref Core//prelude/types/int, loc23_44, loaded [symbolic = @impl.971.%Convert (constants.%Convert.c68)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.1d9 = impl_witness_table (%Core.import_ref.85c), @impl.971 [concrete]
|
||||
// CHECK:STDOUT: %Core.import_ref.78a: @impl.686.%Convert.type (%Convert.type.062) = import_ref Core//prelude/types/int, loc28_39, loaded [symbolic = @impl.686.%Convert (constants.%Convert.527)]
|
||||
// CHECK:STDOUT: %As.impl_witness_table.eb4 = impl_witness_table (%Core.import_ref.78a), @impl.686 [concrete]
|
||||
// CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/operators/as, As, loaded [concrete = constants.%As.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: .c = %c
|
||||
// CHECK:STDOUT: .d = %d
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.f98 = binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.f98 = var_pattern %a.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %tuple.type.261 = var %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc11_18.1: type = splice_block %.loc11_18.5 [concrete = constants.%tuple.type.261] {
|
||||
// CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [concrete = bool]
|
||||
// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_18.2: %tuple.type.24b = tuple_literal (%bool.make_type.loc11, %i32.loc11)
|
||||
// CHECK:STDOUT: %.loc11_18.3: type = value_of_initializer %bool.make_type.loc11 [concrete = bool]
|
||||
// CHECK:STDOUT: %.loc11_18.4: type = converted %bool.make_type.loc11, %.loc11_18.3 [concrete = bool]
|
||||
// CHECK:STDOUT: %.loc11_18.5: type = converted %.loc11_18.2, constants.%tuple.type.261 [concrete = constants.%tuple.type.261]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %tuple.type.261 = bind_name a, %a.var [concrete = %a.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.7ce = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.7ce = var_pattern %b.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc12: type = splice_block %i32.loc12 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.831 = binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %c.var_patt: %pattern_type.831 = var_pattern %c.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref bool = var %c.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc13_8.1: type = splice_block %.loc13_8.3 [concrete = bool] {
|
||||
// CHECK:STDOUT: %bool.make_type.loc13: init type = call constants.%Bool() [concrete = bool]
|
||||
// CHECK:STDOUT: %.loc13_8.2: type = value_of_initializer %bool.make_type.loc13 [concrete = bool]
|
||||
// CHECK:STDOUT: %.loc13_8.3: type = converted %bool.make_type.loc13, %.loc13_8.2 [concrete = bool]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref bool = bind_name c, %c.var [concrete = %c.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %d.patt: %pattern_type.7ce = binding_pattern d [concrete]
|
||||
// CHECK:STDOUT: %d.var_patt: %pattern_type.7ce = var_pattern %d.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d.var: ref %i32 = var %d.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc14: type = splice_block %i32.loc14 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var [concrete = %d.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
|
||||
// CHECK:STDOUT: %int_34: Core.IntLiteral = int_value 34 [concrete = constants.%int_34.3f9]
|
||||
// CHECK:STDOUT: %.loc11_31.1: %tuple.type.3c2 = tuple_literal (%true, %int_34)
|
||||
// CHECK:STDOUT: %tuple.elem0.loc11: ref bool = tuple_access file.%a.var, element0 [concrete = constants.%tuple.elem0]
|
||||
// CHECK:STDOUT: %.loc11_31.2: init bool = initialize_from %true to %tuple.elem0.loc11 [concrete = constants.%true]
|
||||
// CHECK:STDOUT: %impl.elem0.loc11: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_31.1: <bound method> = bound_method %int_34, %impl.elem0.loc11 [concrete = constants.%Convert.bound.82c]
|
||||
// CHECK:STDOUT: %specific_fn.loc11: <specific function> = specific_function %impl.elem0.loc11, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.b6f]
|
||||
// CHECK:STDOUT: %bound_method.loc11_31.2: <bound method> = bound_method %int_34, %specific_fn.loc11 [concrete = constants.%bound_method.34d]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11: init %i32 = call %bound_method.loc11_31.2(%int_34) [concrete = constants.%int_34.980]
|
||||
// CHECK:STDOUT: %.loc11_31.3: init %i32 = converted %int_34, %int.convert_checked.loc11 [concrete = constants.%int_34.980]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc11: ref %i32 = tuple_access file.%a.var, element1 [concrete = constants.%tuple.elem1]
|
||||
// CHECK:STDOUT: %.loc11_31.4: init %i32 = initialize_from %.loc11_31.3 to %tuple.elem1.loc11 [concrete = constants.%int_34.980]
|
||||
// CHECK:STDOUT: %.loc11_31.5: init %tuple.type.261 = tuple_init (%.loc11_31.2, %.loc11_31.4) to file.%a.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_1: init %tuple.type.261 = converted %.loc11_31.1, %.loc11_31.5 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
|
||||
// CHECK:STDOUT: %a.ref.loc12: ref %tuple.type.261 = name_ref a, file.%a [concrete = file.%a.var]
|
||||
// CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc12_28.1: %struct_type.index.b1b = struct_literal (%int_1.loc12)
|
||||
// CHECK:STDOUT: %struct.loc12: %struct_type.index.b1b = struct_value (%int_1.loc12) [concrete = constants.%struct.972]
|
||||
// CHECK:STDOUT: %.loc12_28.2: %struct_type.index.b1b = converted %.loc12_28.1, %struct.loc12 [concrete = constants.%struct.972]
|
||||
// CHECK:STDOUT: %.loc12_29: Core.IntLiteral = struct_access %.loc12_28.2, element0 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc12: ref %i32 = tuple_access %a.ref.loc12, element1 [concrete = constants.%tuple.elem1]
|
||||
// CHECK:STDOUT: %.loc12_15: %i32 = bind_value %tuple.elem1.loc12
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc12_15
|
||||
// CHECK:STDOUT: %a.ref.loc13: ref %tuple.type.261 = name_ref a, file.%a [concrete = file.%a.var]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %impl.elem0.loc13_20.1: %.982 = impl_witness_access constants.%As.impl_witness.6b4, element0 [concrete = constants.%Convert.197]
|
||||
// CHECK:STDOUT: %bound_method.loc13_20.1: <bound method> = bound_method %int_0, %impl.elem0.loc13_20.1 [concrete = constants.%Convert.bound.129]
|
||||
// CHECK:STDOUT: %specific_fn.loc13_20.1: <specific function> = specific_function %impl.elem0.loc13_20.1, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn.aad]
|
||||
// CHECK:STDOUT: %bound_method.loc13_20.2: <bound method> = bound_method %int_0, %specific_fn.loc13_20.1 [concrete = constants.%bound_method.46b]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc13_20.1: init %i32 = call %bound_method.loc13_20.2(%int_0) [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %.loc13_20.1: %i32 = value_of_initializer %int.convert_checked.loc13_20.1 [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %.loc13_20.2: %i32 = converted %int_0, %.loc13_20.1 [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %impl.elem0.loc13_20.2: %.0ea = impl_witness_access constants.%ImplicitAs.impl_witness.a11, element0 [concrete = constants.%Convert.960]
|
||||
// CHECK:STDOUT: %bound_method.loc13_20.3: <bound method> = bound_method %.loc13_20.2, %impl.elem0.loc13_20.2 [concrete = constants.%Convert.bound.0fd]
|
||||
// CHECK:STDOUT: %specific_fn.loc13_20.2: <specific function> = specific_function %impl.elem0.loc13_20.2, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.8a8]
|
||||
// CHECK:STDOUT: %bound_method.loc13_20.4: <bound method> = bound_method %.loc13_20.2, %specific_fn.loc13_20.2 [concrete = constants.%bound_method.4b5]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc13_20.2: init Core.IntLiteral = call %bound_method.loc13_20.4(%.loc13_20.2) [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %.loc13_20.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13_20.2 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %.loc13_20.4: Core.IntLiteral = converted %.loc13_20.2, %.loc13_20.3 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc13: ref bool = tuple_access %a.ref.loc13, element0 [concrete = constants.%tuple.elem0]
|
||||
// CHECK:STDOUT: %.loc13_16: bool = bind_value %tuple.elem0.loc13
|
||||
// CHECK:STDOUT: assign file.%c.var, %.loc13_16
|
||||
// CHECK:STDOUT: %a.ref.loc14: ref %tuple.type.261 = name_ref a, file.%a [concrete = file.%a.var]
|
||||
// CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %impl.elem0.loc14_29: %.982 = impl_witness_access constants.%As.impl_witness.6b4, element0 [concrete = constants.%Convert.197]
|
||||
// CHECK:STDOUT: %bound_method.loc14_29.1: <bound method> = bound_method %int_1.loc14, %impl.elem0.loc14_29 [concrete = constants.%Convert.bound.c1b]
|
||||
// CHECK:STDOUT: %specific_fn.loc14_29: <specific function> = specific_function %impl.elem0.loc14_29, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn.aad]
|
||||
// CHECK:STDOUT: %bound_method.loc14_29.2: <bound method> = bound_method %int_1.loc14, %specific_fn.loc14_29 [concrete = constants.%bound_method.082]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc14_29: init %i32 = call %bound_method.loc14_29.2(%int_1.loc14) [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc14_29.1: %i32 = value_of_initializer %int.convert_checked.loc14_29 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc14_29.2: %i32 = converted %int_1.loc14, %.loc14_29.1 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc14_35.1: %struct_type.index.6ea = struct_literal (%.loc14_29.2)
|
||||
// CHECK:STDOUT: %struct.loc14: %struct_type.index.6ea = struct_value (%.loc14_29.2) [concrete = constants.%struct.63a]
|
||||
// CHECK:STDOUT: %.loc14_35.2: %struct_type.index.6ea = converted %.loc14_35.1, %struct.loc14 [concrete = constants.%struct.63a]
|
||||
// CHECK:STDOUT: %.loc14_36.1: %i32 = struct_access %.loc14_35.2, element0 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc14_36: %.0ea = impl_witness_access constants.%ImplicitAs.impl_witness.a11, element0 [concrete = constants.%Convert.960]
|
||||
// CHECK:STDOUT: %bound_method.loc14_36.1: <bound method> = bound_method %.loc14_36.1, %impl.elem0.loc14_36 [concrete = constants.%Convert.bound.faf]
|
||||
// CHECK:STDOUT: %specific_fn.loc14_36: <specific function> = specific_function %impl.elem0.loc14_36, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.8a8]
|
||||
// CHECK:STDOUT: %bound_method.loc14_36.2: <bound method> = bound_method %.loc14_36.1, %specific_fn.loc14_36 [concrete = constants.%bound_method.711]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc14_36: init Core.IntLiteral = call %bound_method.loc14_36.2(%.loc14_36.1) [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc14_36.2: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_36 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc14_36.3: Core.IntLiteral = converted %.loc14_36.1, %.loc14_36.2 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc14: ref %i32 = tuple_access %a.ref.loc14, element1 [concrete = constants.%tuple.elem1]
|
||||
// CHECK:STDOUT: %.loc14_15: %i32 = bind_value %tuple.elem1.loc14
|
||||
// CHECK:STDOUT: assign file.%d.var, %.loc14_15
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,124 +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/tuple/access/return_value_access.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/return_value_access.carbon
|
||||
|
||||
fn F() -> (i32,) { return (0,); }
|
||||
|
||||
fn Run() -> i32 {
|
||||
return F().0;
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- return_value_access.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.b74: type = pattern_type %tuple.type.a1c [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.5c6, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_0.5c6, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%int_0.6a9) [concrete]
|
||||
// CHECK:STDOUT: %Run.type: type = fn_type @Run [concrete]
|
||||
// CHECK:STDOUT: %Run: %Run.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: .Run = %Run.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.b74 = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.b74 = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_16.1: %tuple.type.85c = tuple_literal (%i32)
|
||||
// CHECK:STDOUT: %.loc11_16.2: type = converted %.loc11_16.1, constants.%tuple.type.a1c [concrete = constants.%tuple.type.a1c]
|
||||
// CHECK:STDOUT: %return.param: ref %tuple.type.a1c = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %tuple.type.a1c = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [concrete = constants.%Run] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() -> %tuple.type.a1c {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %.loc11_30.1: %tuple.type.985 = tuple_literal (%int_0)
|
||||
// CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_30.1: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_30.2: <bound method> = bound_method %int_0, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_30.2(%int_0) [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %.loc11_30.2: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %.loc11_30.3: %i32 = converted %int_0, %.loc11_30.2 [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc11_30.3) [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_31: %tuple.type.a1c = converted %.loc11_30.1, %tuple [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: return %.loc11_31
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Run() -> %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %F.call: init %tuple.type.a1c = call %F.ref()
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %.loc14_12.1: ref %tuple.type.a1c = temporary_storage
|
||||
// CHECK:STDOUT: %.loc14_12.2: ref %tuple.type.a1c = temporary %.loc14_12.1, %F.call
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %.loc14_12.2, element0
|
||||
// CHECK:STDOUT: %.loc14_13: %i32 = bind_value %tuple.elem0
|
||||
// CHECK:STDOUT: return %.loc14_13
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,92 +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/tuple/fail_assign_nested.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_assign_nested.carbon
|
||||
|
||||
// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+4]]:36: error: cannot initialize tuple of 2 elements from tuple with 3 elements [TupleInitElementCountMismatch]
|
||||
// CHECK:STDERR: var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6));
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
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: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.1c9: type = tuple_type (%tuple.type.24b, %tuple.type.24b) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.ff1: type = tuple_type (%tuple.type.d07, %tuple.type.d07) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.72b: type = pattern_type %tuple.type.ff1 [concrete]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.37f: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete]
|
||||
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete]
|
||||
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.e89: type = tuple_type (%tuple.type.37f, %tuple.type.37f) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.72b = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type.72b = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %tuple.type.ff1 = var %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc15_31.1: type = splice_block %.loc15_31.5 [concrete = constants.%tuple.type.ff1] {
|
||||
// CHECK:STDOUT: %int_32.loc15_10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15_10: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc15_15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15_15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc15_18: %tuple.type.24b = tuple_literal (%i32.loc15_10, %i32.loc15_15)
|
||||
// CHECK:STDOUT: %int_32.loc15_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc15_27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15_27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc15_30: %tuple.type.24b = tuple_literal (%i32.loc15_22, %i32.loc15_27)
|
||||
// CHECK:STDOUT: %.loc15_31.2: %tuple.type.1c9 = tuple_literal (%.loc15_18, %.loc15_30)
|
||||
// CHECK:STDOUT: %.loc15_31.3: type = converted %.loc15_18, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: %.loc15_31.4: type = converted %.loc15_30, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: %.loc15_31.5: type = converted %.loc15_31.2, constants.%tuple.type.ff1 [concrete = constants.%tuple.type.ff1]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %tuple.type.ff1 = bind_name x, %x.var [concrete = %x.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
|
||||
// CHECK:STDOUT: %.loc15_44: %tuple.type.37f = tuple_literal (%int_1, %int_2, %int_3)
|
||||
// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4]
|
||||
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5]
|
||||
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6]
|
||||
// CHECK:STDOUT: %.loc15_55: %tuple.type.37f = tuple_literal (%int_4, %int_5, %int_6)
|
||||
// CHECK:STDOUT: %.loc15_56: %tuple.type.e89 = tuple_literal (%.loc15_44, %.loc15_55)
|
||||
// CHECK:STDOUT: assign file.%x.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,104 +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/tuple/fail_element_type_mismatch.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon
|
||||
|
||||
// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+7]]:21: error: cannot implicitly convert expression of type `f64` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: var x: (i32, i32) = (2, 65.89);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+4]]:21: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: var x: (i32, i32) = (2, 65.89);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var x: (i32, i32) = (2, 65.89);
|
||||
|
||||
// CHECK:STDOUT: --- fail_element_type_mismatch.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %float: f64 = float_literal 65.890000000000001 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.2c1: type = tuple_type (Core.IntLiteral, f64) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%x.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.511 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type.511 = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %tuple.type.d07 = var %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc18_17.1: type = splice_block %.loc18_17.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc18_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc18_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc18_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc18_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc18_17.2: %tuple.type.24b = tuple_literal (%i32.loc18_9, %i32.loc18_14)
|
||||
// CHECK:STDOUT: %.loc18_17.3: type = converted %.loc18_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %tuple.type.d07 = bind_name x, %x.var [concrete = %x.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %float: f64 = float_literal 65.890000000000001 [concrete = constants.%float]
|
||||
// CHECK:STDOUT: %.loc18_30.1: %tuple.type.2c1 = tuple_literal (%int_2, %float)
|
||||
// CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc18_30.1: <bound method> = bound_method %int_2, %impl.elem0 [concrete = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc18_30.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc18_30.2(%int_2) [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc18_30.2: init %i32 = converted %int_2, %int.convert_checked [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%x.var, element0 [concrete = constants.%tuple.elem0]
|
||||
// CHECK:STDOUT: %.loc18_30.3: init %i32 = initialize_from %.loc18_30.2 to %tuple.elem0 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc18_30.4: %i32 = converted %float, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: assign file.%x.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,92 +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/tuple/fail_nested_incomplete.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_nested_incomplete.carbon
|
||||
|
||||
class Incomplete;
|
||||
|
||||
// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+7]]:8: error: binding pattern has incomplete type `(i32, Incomplete)` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: var t: (i32, Incomplete);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class Incomplete;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var t: (i32, Incomplete);
|
||||
|
||||
var p: Incomplete* = &t[1];
|
||||
|
||||
// CHECK:STDOUT: --- fail_nested_incomplete.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.8a4: type = tuple_type (%i32, %Incomplete) [concrete]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Incomplete [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.275: type = pattern_type %ptr [concrete]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .Incomplete = %Incomplete.decl
|
||||
// CHECK:STDOUT: .t = %t
|
||||
// CHECK:STDOUT: .p = %p
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [concrete = constants.%Incomplete] {} {}
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %t.patt: <error> = binding_pattern t [concrete]
|
||||
// CHECK:STDOUT: %t.var_patt: <error> = var_pattern %t.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t.var: ref <error> = var %t.var_patt [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc20_24.1: type = splice_block %.loc20_24.3 [concrete = constants.%tuple.type.8a4] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %Incomplete.ref.loc20: type = name_ref Incomplete, %Incomplete.decl [concrete = constants.%Incomplete]
|
||||
// CHECK:STDOUT: %.loc20_24.2: %tuple.type.24b = tuple_literal (%i32, %Incomplete.ref.loc20)
|
||||
// CHECK:STDOUT: %.loc20_24.3: type = converted %.loc20_24.2, constants.%tuple.type.8a4 [concrete = constants.%tuple.type.8a4]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t: <error> = bind_name t, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %p.patt: %pattern_type.275 = binding_pattern p [concrete]
|
||||
// CHECK:STDOUT: %p.var_patt: %pattern_type.275 = var_pattern %p.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p.var: ref %ptr = var %p.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc22: type = splice_block %ptr [concrete = constants.%ptr] {
|
||||
// CHECK:STDOUT: %Incomplete.ref.loc22: type = name_ref Incomplete, %Incomplete.decl [concrete = constants.%Incomplete]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Incomplete.ref.loc22 [concrete = constants.%ptr]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p: ref %ptr = bind_name p, %p.var [concrete = %p.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Incomplete;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %t.ref: <error> = name_ref t, file.%t [concrete = <error>]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %addr: <error> = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: assign file.%p.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,69 +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/tuple/fail_too_few_element.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_too_few_element.carbon
|
||||
|
||||
// CHECK:STDERR: fail_too_few_element.carbon:[[@LINE+4]]:21: error: cannot initialize tuple of 2 elements from tuple with 1 element [TupleInitElementCountMismatch]
|
||||
// CHECK:STDERR: var x: (i32, i32) = (2, );
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
var x: (i32, i32) = (2, );
|
||||
|
||||
// CHECK:STDOUT: --- fail_too_few_element.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.511 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type.511 = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %tuple.type.d07 = var %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc15_17.1: type = splice_block %.loc15_17.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc15_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc15_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc15_17.2: %tuple.type.24b = tuple_literal (%i32.loc15_9, %i32.loc15_14)
|
||||
// CHECK:STDOUT: %.loc15_17.3: type = converted %.loc15_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %tuple.type.d07 = bind_name x, %x.var [concrete = %x.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc15: %tuple.type.985 = tuple_literal (%int_2)
|
||||
// CHECK:STDOUT: assign file.%x.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,74 +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/tuple/fail_type_assign.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_type_assign.carbon
|
||||
|
||||
// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+7]]:18: error: cannot implicitly convert expression of type `type` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: var x: (i32, ) = (i32, );
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+4]]:18: note: type `type` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: var x: (i32, ) = (i32, );
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var x: (i32, ) = (i32, );
|
||||
|
||||
// CHECK:STDOUT: --- fail_type_assign.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.b74: type = pattern_type %tuple.type.a1c [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.b74 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type.b74 = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %tuple.type.a1c = var %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc18_14.1: type = splice_block %.loc18_14.3 [concrete = constants.%tuple.type.a1c] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc18_14.2: %tuple.type.85c = tuple_literal (%i32)
|
||||
// CHECK:STDOUT: %.loc18_14.3: type = converted %.loc18_14.2, constants.%tuple.type.a1c [concrete = constants.%tuple.type.a1c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %tuple.type.a1c = bind_name x, %x.var [concrete = %x.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc18_24.1: %tuple.type.85c = tuple_literal (%i32)
|
||||
// CHECK:STDOUT: %.loc18_24.2: %i32 = converted %i32, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: assign file.%x.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,56 +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/tuple/fail_value_as_type.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_value_as_type.carbon
|
||||
|
||||
// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+7]]:8: error: cannot implicitly convert non-type value of type `Core.IntLiteral` to `type` [ConversionFailureNonTypeToFacet]
|
||||
// CHECK:STDERR: var x: (1, );
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+4]]:8: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: var x: (1, );
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
var x: (1, );
|
||||
|
||||
// CHECK:STDOUT: --- fail_value_as_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: <error> = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: <error> = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref <error> = var %x.var_patt [concrete = <error>]
|
||||
// CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc18_12.1: %tuple.type = tuple_literal (%int_1)
|
||||
// CHECK:STDOUT: %.loc18_12.2: type = converted %int_1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: <error> = bind_name x, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
-810
@@ -1,810 +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/tuple/import.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/import.carbon
|
||||
|
||||
// --- implicit.carbon
|
||||
|
||||
package Implicit;
|
||||
|
||||
var a_ref: (i32,) = (0,);
|
||||
var b_ref: (((i32,), i32), (i32, i32)) = (((0,), 1), (2, 3));
|
||||
|
||||
class C(X:! (i32, i32)) {}
|
||||
|
||||
fn F() -> C((1, 2));
|
||||
|
||||
// --- implicit.impl.carbon
|
||||
|
||||
impl package Implicit;
|
||||
|
||||
var a: (i32,) = a_ref;
|
||||
var b: (((i32,), i32), (i32, i32)) = b_ref;
|
||||
var c: C((1, 2)) = F();
|
||||
|
||||
// --- fail_bad_type.impl.carbon
|
||||
|
||||
impl package Implicit;
|
||||
|
||||
// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+8]]:14: error: cannot initialize tuple of 2 elements from tuple with 3 elements [TupleInitElementCountMismatch]
|
||||
// CHECK:STDERR: var c_bad: C((1, 2, 3)) = F();
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: implicit.carbon:7:9: note: initializing generic parameter `X` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: class C(X:! (i32, i32)) {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var c_bad: C((1, 2, 3)) = F();
|
||||
|
||||
// --- fail_bad_value.impl.carbon
|
||||
|
||||
impl package Implicit;
|
||||
|
||||
// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+7]]:1: error: cannot implicitly convert expression of type `C((1, 2))` to `C((3, 4))` [ConversionFailure]
|
||||
// CHECK:STDERR: var c_bad: C((3, 4)) = F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+4]]:1: note: type `C((1, 2))` does not implement interface `Core.ImplicitAs(C((3, 4)))` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: var c_bad: C((3, 4)) = F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var c_bad: C((3, 4)) = F();
|
||||
|
||||
// CHECK:STDOUT: --- implicit.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.b74: type = pattern_type %tuple.type.a1c [concrete]
|
||||
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.d04: <bound method> = bound_method %int_0.5c6, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.b6e: <bound method> = bound_method %int_0.5c6, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.592: %tuple.type.a1c = tuple_value (%int_0.6a9) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.8c7: type = tuple_type (%tuple.type.85c, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.58c: type = tuple_type (%tuple.type.8c7, %tuple.type.24b) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.fe6: type = tuple_type (%tuple.type.a1c, %i32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.fc1: type = tuple_type (%tuple.type.fe6, %tuple.type.d07) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.811: type = pattern_type %tuple.type.fc1 [concrete]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.186: type = tuple_type (%tuple.type.985, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d47: type = tuple_type (%tuple.type.186, %tuple.type.f94) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.f2b: ref %tuple.type.fe6 = tuple_access file.%b_ref.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.519: ref %tuple.type.a1c = tuple_access %tuple.elem0.f2b, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.204: ref %i32 = tuple_access %tuple.elem0.f2b, element1 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.ab5: <bound method> = bound_method %int_1.5b8, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.9a1: <bound method> = bound_method %int_1.5b8, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.236: %tuple.type.fe6 = tuple_value (%tuple.592, %int_1.5d2) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.98d: ref %tuple.type.d07 = tuple_access file.%b_ref.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.965: ref %i32 = tuple_access %tuple.elem1.98d, element0 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.b92: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.07d: ref %i32 = tuple_access %tuple.elem1.98d, element1 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.b30: <bound method> = bound_method %int_3.1ba, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.047: <bound method> = bound_method %int_3.1ba, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %tuple.11a: %tuple.type.d07 = tuple_value (%int_2.ef8, %int_3.822) [concrete]
|
||||
// CHECK:STDOUT: %tuple.ba9: %tuple.type.fc1 = tuple_value (%tuple.236, %tuple.11a) [concrete]
|
||||
// CHECK:STDOUT: %X: %tuple.type.d07 = bind_symbolic_name X, 0 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete]
|
||||
// CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
|
||||
// CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.54f: type = class_type @C, @C(%X) [symbolic]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %tuple.21c: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [concrete]
|
||||
// CHECK:STDOUT: %C.ee0: type = class_type @C, @C(%tuple.21c) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7fe: type = pattern_type %C.ee0 [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .a_ref = %a_ref
|
||||
// CHECK:STDOUT: .b_ref = %b_ref
|
||||
// CHECK:STDOUT: .C = %C.decl
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a_ref.patt: %pattern_type.b74 = binding_pattern a_ref [concrete]
|
||||
// CHECK:STDOUT: %a_ref.var_patt: %pattern_type.b74 = var_pattern %a_ref.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a_ref.var: ref %tuple.type.a1c = var %a_ref.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc4_17.1: type = splice_block %.loc4_17.3 [concrete = constants.%tuple.type.a1c] {
|
||||
// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4_17.2: %tuple.type.85c = tuple_literal (%i32.loc4)
|
||||
// CHECK:STDOUT: %.loc4_17.3: type = converted %.loc4_17.2, constants.%tuple.type.a1c [concrete = constants.%tuple.type.a1c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a_ref: ref %tuple.type.a1c = bind_name a_ref, %a_ref.var [concrete = %a_ref.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b_ref.patt: %pattern_type.811 = binding_pattern b_ref [concrete]
|
||||
// CHECK:STDOUT: %b_ref.var_patt: %pattern_type.811 = var_pattern %b_ref.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b_ref.var: ref %tuple.type.fc1 = var %b_ref.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc5_38.1: type = splice_block %.loc5_38.6 [concrete = constants.%tuple.type.fc1] {
|
||||
// CHECK:STDOUT: %int_32.loc5_15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5_15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_19: %tuple.type.85c = tuple_literal (%i32.loc5_15)
|
||||
// CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_25: %tuple.type.8c7 = tuple_literal (%.loc5_19, %i32.loc5_22)
|
||||
// CHECK:STDOUT: %int_32.loc5_29: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5_29: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc5_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_37: %tuple.type.24b = tuple_literal (%i32.loc5_29, %i32.loc5_34)
|
||||
// CHECK:STDOUT: %.loc5_38.2: %tuple.type.58c = tuple_literal (%.loc5_25, %.loc5_37)
|
||||
// CHECK:STDOUT: %.loc5_38.3: type = converted %.loc5_19, constants.%tuple.type.a1c [concrete = constants.%tuple.type.a1c]
|
||||
// CHECK:STDOUT: %.loc5_38.4: type = converted %.loc5_25, constants.%tuple.type.fe6 [concrete = constants.%tuple.type.fe6]
|
||||
// CHECK:STDOUT: %.loc5_38.5: type = converted %.loc5_37, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: %.loc5_38.6: type = converted %.loc5_38.2, constants.%tuple.type.fc1 [concrete = constants.%tuple.type.fc1]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b_ref: ref %tuple.type.fc1 = bind_name b_ref, %b_ref.var [concrete = %b_ref.var]
|
||||
// CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
|
||||
// CHECK:STDOUT: %X.patt: %pattern_type.511 = symbolic_binding_pattern X, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc7_22.1: type = splice_block %.loc7_22.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc7_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc7_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc7_22.2: %tuple.type.24b = tuple_literal (%i32.loc7_14, %i32.loc7_19)
|
||||
// CHECK:STDOUT: %.loc7_22.3: type = converted %.loc7_22.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %X.loc7_9.1: %tuple.type.d07 = bind_symbolic_name X, 0 [symbolic = %X.loc7_9.2 (constants.%X)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7fe = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.7fe = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc9_18.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2)
|
||||
// CHECK:STDOUT: %impl.elem0.loc9_18.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc9_18.1: <bound method> = bound_method %int_1, %impl.elem0.loc9_18.1 [concrete = constants.%Convert.bound.ab5]
|
||||
// CHECK:STDOUT: %specific_fn.loc9_18.1: <specific function> = specific_function %impl.elem0.loc9_18.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc9_18.2: <bound method> = bound_method %int_1, %specific_fn.loc9_18.1 [concrete = constants.%bound_method.9a1]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc9_18.1: init %i32 = call %bound_method.loc9_18.2(%int_1) [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc9_18.2: %i32 = value_of_initializer %int.convert_checked.loc9_18.1 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc9_18.3: %i32 = converted %int_1, %.loc9_18.2 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc9_18.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc9_18.3: <bound method> = bound_method %int_2, %impl.elem0.loc9_18.2 [concrete = constants.%Convert.bound.ef9]
|
||||
// CHECK:STDOUT: %specific_fn.loc9_18.2: <specific function> = specific_function %impl.elem0.loc9_18.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc9_18.4: <bound method> = bound_method %int_2, %specific_fn.loc9_18.2 [concrete = constants.%bound_method.b92]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc9_18.2: init %i32 = call %bound_method.loc9_18.4(%int_2) [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc9_18.4: %i32 = value_of_initializer %int.convert_checked.loc9_18.2 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc9_18.5: %i32 = converted %int_2, %.loc9_18.4 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc9_18.3, %.loc9_18.5) [concrete = constants.%tuple.21c]
|
||||
// CHECK:STDOUT: %.loc9_19: %tuple.type.d07 = converted %.loc9_18.1, %tuple [concrete = constants.%tuple.21c]
|
||||
// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.21c) [concrete = constants.%C.ee0]
|
||||
// CHECK:STDOUT: %return.param: ref %C.ee0 = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %C.ee0 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @C(%X.loc7_9.1: %tuple.type.d07) {
|
||||
// CHECK:STDOUT: %X.loc7_9.2: %tuple.type.d07 = bind_symbolic_name X, 0 [symbolic = %X.loc7_9.2 (constants.%X)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C.54f
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() -> %C.ee0;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_0.loc4: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %.loc4_24.1: %tuple.type.985 = tuple_literal (%int_0.loc4)
|
||||
// CHECK:STDOUT: %impl.elem0.loc4: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc4_24.1: <bound method> = bound_method %int_0.loc4, %impl.elem0.loc4 [concrete = constants.%Convert.bound.d04]
|
||||
// CHECK:STDOUT: %specific_fn.loc4: <specific function> = specific_function %impl.elem0.loc4, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc4_24.2: <bound method> = bound_method %int_0.loc4, %specific_fn.loc4 [concrete = constants.%bound_method.b6e]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %bound_method.loc4_24.2(%int_0.loc4) [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %.loc4_24.2: init %i32 = converted %int_0.loc4, %int.convert_checked.loc4 [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %.loc4_24.3: init %tuple.type.a1c = tuple_init (%.loc4_24.2) to file.%a_ref.var [concrete = constants.%tuple.592]
|
||||
// CHECK:STDOUT: %.loc4_1: init %tuple.type.a1c = converted %.loc4_24.1, %.loc4_24.3 [concrete = constants.%tuple.592]
|
||||
// CHECK:STDOUT: assign file.%a_ref.var, %.loc4_1
|
||||
// CHECK:STDOUT: %int_0.loc5: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %.loc5_47.1: %tuple.type.985 = tuple_literal (%int_0.loc5)
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc5_51.1: %tuple.type.186 = tuple_literal (%.loc5_47.1, %int_1)
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc5_59.1: %tuple.type.f94 = tuple_literal (%int_2, %int_3)
|
||||
// CHECK:STDOUT: %.loc5_60.1: %tuple.type.d47 = tuple_literal (%.loc5_51.1, %.loc5_59.1)
|
||||
// CHECK:STDOUT: %impl.elem0.loc5_47: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc5_47.1: <bound method> = bound_method %int_0.loc5, %impl.elem0.loc5_47 [concrete = constants.%Convert.bound.d04]
|
||||
// CHECK:STDOUT: %specific_fn.loc5_47: <specific function> = specific_function %impl.elem0.loc5_47, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc5_47.2: <bound method> = bound_method %int_0.loc5, %specific_fn.loc5_47 [concrete = constants.%bound_method.b6e]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc5_47: init %i32 = call %bound_method.loc5_47.2(%int_0.loc5) [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %.loc5_47.2: init %i32 = converted %int_0.loc5, %int.convert_checked.loc5_47 [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc5_60: ref %tuple.type.fe6 = tuple_access file.%b_ref.var, element0 [concrete = constants.%tuple.elem0.f2b]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc5_51: ref %tuple.type.a1c = tuple_access %tuple.elem0.loc5_60, element0 [concrete = constants.%tuple.elem0.519]
|
||||
// CHECK:STDOUT: %.loc5_47.3: init %tuple.type.a1c = tuple_init (%.loc5_47.2) to %tuple.elem0.loc5_51 [concrete = constants.%tuple.592]
|
||||
// CHECK:STDOUT: %.loc5_51.2: init %tuple.type.a1c = converted %.loc5_47.1, %.loc5_47.3 [concrete = constants.%tuple.592]
|
||||
// CHECK:STDOUT: %.loc5_51.3: init %tuple.type.a1c = initialize_from %.loc5_51.2 to %tuple.elem0.loc5_51 [concrete = constants.%tuple.592]
|
||||
// CHECK:STDOUT: %impl.elem0.loc5_51: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc5_51.1: <bound method> = bound_method %int_1, %impl.elem0.loc5_51 [concrete = constants.%Convert.bound.ab5]
|
||||
// CHECK:STDOUT: %specific_fn.loc5_51: <specific function> = specific_function %impl.elem0.loc5_51, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc5_51.2: <bound method> = bound_method %int_1, %specific_fn.loc5_51 [concrete = constants.%bound_method.9a1]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc5_51: init %i32 = call %bound_method.loc5_51.2(%int_1) [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc5_51.4: init %i32 = converted %int_1, %int.convert_checked.loc5_51 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc5_51: ref %i32 = tuple_access %tuple.elem0.loc5_60, element1 [concrete = constants.%tuple.elem1.204]
|
||||
// CHECK:STDOUT: %.loc5_51.5: init %i32 = initialize_from %.loc5_51.4 to %tuple.elem1.loc5_51 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc5_51.6: init %tuple.type.fe6 = tuple_init (%.loc5_51.3, %.loc5_51.5) to %tuple.elem0.loc5_60 [concrete = constants.%tuple.236]
|
||||
// CHECK:STDOUT: %.loc5_60.2: init %tuple.type.fe6 = converted %.loc5_51.1, %.loc5_51.6 [concrete = constants.%tuple.236]
|
||||
// CHECK:STDOUT: %impl.elem0.loc5_59.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc5_59.1: <bound method> = bound_method %int_2, %impl.elem0.loc5_59.1 [concrete = constants.%Convert.bound.ef9]
|
||||
// CHECK:STDOUT: %specific_fn.loc5_59.1: <specific function> = specific_function %impl.elem0.loc5_59.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc5_59.2: <bound method> = bound_method %int_2, %specific_fn.loc5_59.1 [concrete = constants.%bound_method.b92]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc5_59.1: init %i32 = call %bound_method.loc5_59.2(%int_2) [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc5_59.2: init %i32 = converted %int_2, %int.convert_checked.loc5_59.1 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc5_60: ref %tuple.type.d07 = tuple_access file.%b_ref.var, element1 [concrete = constants.%tuple.elem1.98d]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc5_59: ref %i32 = tuple_access %tuple.elem1.loc5_60, element0 [concrete = constants.%tuple.elem0.965]
|
||||
// CHECK:STDOUT: %.loc5_59.3: init %i32 = initialize_from %.loc5_59.2 to %tuple.elem0.loc5_59 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc5_59.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc5_59.3: <bound method> = bound_method %int_3, %impl.elem0.loc5_59.2 [concrete = constants.%Convert.bound.b30]
|
||||
// CHECK:STDOUT: %specific_fn.loc5_59.2: <specific function> = specific_function %impl.elem0.loc5_59.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc5_59.4: <bound method> = bound_method %int_3, %specific_fn.loc5_59.2 [concrete = constants.%bound_method.047]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc5_59.2: init %i32 = call %bound_method.loc5_59.4(%int_3) [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc5_59.4: init %i32 = converted %int_3, %int.convert_checked.loc5_59.2 [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc5_59: ref %i32 = tuple_access %tuple.elem1.loc5_60, element1 [concrete = constants.%tuple.elem1.07d]
|
||||
// CHECK:STDOUT: %.loc5_59.5: init %i32 = initialize_from %.loc5_59.4 to %tuple.elem1.loc5_59 [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc5_59.6: init %tuple.type.d07 = tuple_init (%.loc5_59.3, %.loc5_59.5) to %tuple.elem1.loc5_60 [concrete = constants.%tuple.11a]
|
||||
// CHECK:STDOUT: %.loc5_60.3: init %tuple.type.d07 = converted %.loc5_59.1, %.loc5_59.6 [concrete = constants.%tuple.11a]
|
||||
// CHECK:STDOUT: %.loc5_60.4: init %tuple.type.fc1 = tuple_init (%.loc5_60.2, %.loc5_60.3) to file.%b_ref.var [concrete = constants.%tuple.ba9]
|
||||
// CHECK:STDOUT: %.loc5_1: init %tuple.type.fc1 = converted %.loc5_60.1, %.loc5_60.4 [concrete = constants.%tuple.ba9]
|
||||
// CHECK:STDOUT: assign file.%b_ref.var, %.loc5_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @C(constants.%X) {
|
||||
// CHECK:STDOUT: %X.loc7_9.2 => constants.%X
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @C(constants.%tuple.21c) {
|
||||
// CHECK:STDOUT: %X.loc7_9.2 => constants.%tuple.21c
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- implicit.impl.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.595: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.595 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.9a6: type = fn_type @Convert.2, @impl.a8d(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.458: %Convert.type.9a6 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.dd4: type = tuple_type (%i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.2e8: type = pattern_type %tuple.type.dd4 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.994: ref %i32 = tuple_access imports.%a_ref.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.8c7: type = tuple_type (%tuple.type.85c, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.58c: type = tuple_type (%tuple.type.8c7, %tuple.type.24b) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.154: type = tuple_type (%tuple.type.dd4, %i32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.c2c: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.cfa: type = tuple_type (%tuple.type.154, %tuple.type.c2c) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.ab9: type = pattern_type %tuple.type.cfa [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.693: ref %tuple.type.154 = tuple_access imports.%b_ref.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.76a: ref %tuple.type.154 = tuple_access file.%b.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.4c9: ref %tuple.type.dd4 = tuple_access %tuple.elem0.693, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.6fd: ref %tuple.type.dd4 = tuple_access %tuple.elem0.76a, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.390: ref %i32 = tuple_access %tuple.elem0.4c9, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.723: ref %i32 = tuple_access %tuple.elem0.693, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.ae3: ref %i32 = tuple_access %tuple.elem0.76a, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.92b: ref %tuple.type.c2c = tuple_access imports.%b_ref.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.4f3: ref %tuple.type.c2c = tuple_access file.%b.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.2ff: ref %i32 = tuple_access %tuple.elem1.92b, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.790: ref %i32 = tuple_access %tuple.elem1.4f3, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.282: ref %i32 = tuple_access %tuple.elem1.92b, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.822: ref %i32 = tuple_access %tuple.elem1.4f3, element1 [concrete]
|
||||
// CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
|
||||
// CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.b9e: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.ea0: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.2ce: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.1ad, @impl.a8d(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.e14: type = fn_type @Convert.2, @impl.a8d(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.4cb: %Convert.type.e14 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.2ce) [concrete]
|
||||
// CHECK:STDOUT: %.940: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.dc5: <bound method> = bound_method %int_1.5b8, %Convert.4cb [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.4cb, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.c37: <bound method> = bound_method %int_1.5b8, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.30f: <bound method> = bound_method %int_2.ecc, %Convert.4cb [concrete]
|
||||
// CHECK:STDOUT: %bound_method.62b: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_2.d0d: %i32 = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%int_1.47b, %int_2.d0d) [concrete]
|
||||
// CHECK:STDOUT: %C.cf0: type = class_type @C, @C(%tuple) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7e2: type = pattern_type %C.cf0 [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Implicit.a_ref: ref %tuple.type.dd4 = import_ref Implicit//default, a_ref, loaded [concrete = %a_ref.var]
|
||||
// CHECK:STDOUT: %Implicit.b_ref: ref %tuple.type.cfa = import_ref Implicit//default, b_ref, loaded [concrete = %b_ref.var]
|
||||
// CHECK:STDOUT: %Implicit.C: %C.type = import_ref Implicit//default, C, loaded [concrete = constants.%C.generic]
|
||||
// CHECK:STDOUT: %Implicit.F: %F.type = import_ref Implicit//default, F, loaded [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %Core.ece: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Implicit.import_ref.773: @impl.a8d.%Convert.type (%Convert.type.9a6) = import_ref Implicit//default, inst119 [indirect], loaded [symbolic = @impl.a8d.%Convert (constants.%Convert.458)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.1ad = impl_witness_table (%Implicit.import_ref.773), @impl.a8d [concrete]
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %a_ref.patt: %pattern_type.2e8 = binding_pattern a_ref [concrete]
|
||||
// CHECK:STDOUT: %a_ref.var_patt: %pattern_type.2e8 = var_pattern %a_ref.patt [concrete]
|
||||
// CHECK:STDOUT: %a_ref.var: ref %tuple.type.dd4 = var %a_ref.var_patt [concrete]
|
||||
// CHECK:STDOUT: %b_ref.patt: %pattern_type.ab9 = binding_pattern b_ref [concrete]
|
||||
// CHECK:STDOUT: %b_ref.var_patt: %pattern_type.ab9 = var_pattern %b_ref.patt [concrete]
|
||||
// CHECK:STDOUT: %b_ref.var: ref %tuple.type.cfa = var %b_ref.var_patt [concrete]
|
||||
// CHECK:STDOUT: %Implicit.import_ref.48d: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)]
|
||||
// CHECK:STDOUT: %Implicit.import_ref.8f2: <witness> = import_ref Implicit//default, loc7_26, loaded [concrete = constants.%complete_type.357]
|
||||
// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1463 [no loc], unloaded
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.595 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .a_ref = imports.%Implicit.a_ref
|
||||
// CHECK:STDOUT: .b_ref = imports.%Implicit.b_ref
|
||||
// CHECK:STDOUT: .C = imports.%Implicit.C
|
||||
// CHECK:STDOUT: .F = imports.%Implicit.F
|
||||
// CHECK:STDOUT: .Core = imports.%Core.ece
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: .c = %c
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Implicit.import = import Implicit
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.2e8 = binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.2e8 = var_pattern %a.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %tuple.type.dd4 = var %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc4_13.1: type = splice_block %.loc4_13.3 [concrete = constants.%tuple.type.dd4] {
|
||||
// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4_13.2: %tuple.type.85c = tuple_literal (%i32.loc4)
|
||||
// CHECK:STDOUT: %.loc4_13.3: type = converted %.loc4_13.2, constants.%tuple.type.dd4 [concrete = constants.%tuple.type.dd4]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %tuple.type.dd4 = bind_name a, %a.var [concrete = %a.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.ab9 = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.ab9 = var_pattern %b.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %tuple.type.cfa = var %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc5_34.1: type = splice_block %.loc5_34.6 [concrete = constants.%tuple.type.cfa] {
|
||||
// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_15: %tuple.type.85c = tuple_literal (%i32.loc5_11)
|
||||
// CHECK:STDOUT: %int_32.loc5_18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5_18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_21: %tuple.type.8c7 = tuple_literal (%.loc5_15, %i32.loc5_18)
|
||||
// CHECK:STDOUT: %int_32.loc5_25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5_25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc5_30: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5_30: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_33: %tuple.type.24b = tuple_literal (%i32.loc5_25, %i32.loc5_30)
|
||||
// CHECK:STDOUT: %.loc5_34.2: %tuple.type.58c = tuple_literal (%.loc5_21, %.loc5_33)
|
||||
// CHECK:STDOUT: %.loc5_34.3: type = converted %.loc5_15, constants.%tuple.type.dd4 [concrete = constants.%tuple.type.dd4]
|
||||
// CHECK:STDOUT: %.loc5_34.4: type = converted %.loc5_21, constants.%tuple.type.154 [concrete = constants.%tuple.type.154]
|
||||
// CHECK:STDOUT: %.loc5_34.5: type = converted %.loc5_33, constants.%tuple.type.c2c [concrete = constants.%tuple.type.c2c]
|
||||
// CHECK:STDOUT: %.loc5_34.6: type = converted %.loc5_34.2, constants.%tuple.type.cfa [concrete = constants.%tuple.type.cfa]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %tuple.type.cfa = bind_name b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.7e2 = binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %c.var_patt: %pattern_type.7e2 = var_pattern %c.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %C.cf0 = var %c.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc6_16.1: type = splice_block %C [concrete = constants.%C.cf0] {
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Implicit.C [concrete = constants.%C.generic]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc6_15.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2)
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_15.1: %.940 = impl_witness_access constants.%ImplicitAs.impl_witness.2ce, element0 [concrete = constants.%Convert.4cb]
|
||||
// CHECK:STDOUT: %bound_method.loc6_15.1: <bound method> = bound_method %int_1, %impl.elem0.loc6_15.1 [concrete = constants.%Convert.bound.dc5]
|
||||
// CHECK:STDOUT: %specific_fn.loc6_15.1: <specific function> = specific_function %impl.elem0.loc6_15.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc6_15.2: <bound method> = bound_method %int_1, %specific_fn.loc6_15.1 [concrete = constants.%bound_method.c37]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc6_15.1: init %i32 = call %bound_method.loc6_15.2(%int_1) [concrete = constants.%int_1.47b]
|
||||
// CHECK:STDOUT: %.loc6_15.2: %i32 = value_of_initializer %int.convert_checked.loc6_15.1 [concrete = constants.%int_1.47b]
|
||||
// CHECK:STDOUT: %.loc6_15.3: %i32 = converted %int_1, %.loc6_15.2 [concrete = constants.%int_1.47b]
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_15.2: %.940 = impl_witness_access constants.%ImplicitAs.impl_witness.2ce, element0 [concrete = constants.%Convert.4cb]
|
||||
// CHECK:STDOUT: %bound_method.loc6_15.3: <bound method> = bound_method %int_2, %impl.elem0.loc6_15.2 [concrete = constants.%Convert.bound.30f]
|
||||
// CHECK:STDOUT: %specific_fn.loc6_15.2: <specific function> = specific_function %impl.elem0.loc6_15.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc6_15.4: <bound method> = bound_method %int_2, %specific_fn.loc6_15.2 [concrete = constants.%bound_method.62b]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc6_15.2: init %i32 = call %bound_method.loc6_15.4(%int_2) [concrete = constants.%int_2.d0d]
|
||||
// CHECK:STDOUT: %.loc6_15.4: %i32 = value_of_initializer %int.convert_checked.loc6_15.2 [concrete = constants.%int_2.d0d]
|
||||
// CHECK:STDOUT: %.loc6_15.5: %i32 = converted %int_2, %.loc6_15.4 [concrete = constants.%int_2.d0d]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%.loc6_15.3, %.loc6_15.5) [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc6_16.2: %tuple.type.c2c = converted %.loc6_15.1, %tuple [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple) [concrete = constants.%C.cf0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %C.cf0 = bind_name c, %c.var [concrete = %c.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.48d: %tuple.type.c2c) [from "implicit.carbon"] {
|
||||
// CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: complete_type_witness = imports.%Implicit.import_ref.8f2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = imports.%Implicit.import_ref.964
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F [from "implicit.carbon"];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %a_ref.ref: ref %tuple.type.dd4 = name_ref a_ref, imports.%Implicit.a_ref [concrete = imports.%a_ref.var]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc4: ref %i32 = tuple_access %a_ref.ref, element0 [concrete = constants.%tuple.elem0.994]
|
||||
// CHECK:STDOUT: %.loc4_17.1: %i32 = bind_value %tuple.elem0.loc4
|
||||
// CHECK:STDOUT: %.loc4_17.2: init %tuple.type.dd4 = tuple_init (%.loc4_17.1) to file.%a.var
|
||||
// CHECK:STDOUT: %.loc4_1: init %tuple.type.dd4 = converted %a_ref.ref, %.loc4_17.2
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc4_1
|
||||
// CHECK:STDOUT: %b_ref.ref: ref %tuple.type.cfa = name_ref b_ref, imports.%Implicit.b_ref [concrete = imports.%b_ref.var]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc5_38.1: ref %tuple.type.154 = tuple_access %b_ref.ref, element0 [concrete = constants.%tuple.elem0.693]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc5_38.2: ref %tuple.type.dd4 = tuple_access %tuple.elem0.loc5_38.1, element0 [concrete = constants.%tuple.elem0.4c9]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc5_38.3: ref %i32 = tuple_access %tuple.elem0.loc5_38.2, element0 [concrete = constants.%tuple.elem0.390]
|
||||
// CHECK:STDOUT: %.loc5_38.1: %i32 = bind_value %tuple.elem0.loc5_38.3
|
||||
// CHECK:STDOUT: %tuple.elem0.loc5_38.4: ref %tuple.type.154 = tuple_access file.%b.var, element0 [concrete = constants.%tuple.elem0.76a]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc5_38.5: ref %tuple.type.dd4 = tuple_access %tuple.elem0.loc5_38.4, element0 [concrete = constants.%tuple.elem0.6fd]
|
||||
// CHECK:STDOUT: %.loc5_38.2: init %tuple.type.dd4 = tuple_init (%.loc5_38.1) to %tuple.elem0.loc5_38.5
|
||||
// CHECK:STDOUT: %.loc5_38.3: init %tuple.type.dd4 = converted %tuple.elem0.loc5_38.2, %.loc5_38.2
|
||||
// CHECK:STDOUT: %.loc5_38.4: init %tuple.type.dd4 = initialize_from %.loc5_38.3 to %tuple.elem0.loc5_38.5
|
||||
// CHECK:STDOUT: %tuple.elem1.loc5_38.1: ref %i32 = tuple_access %tuple.elem0.loc5_38.1, element1 [concrete = constants.%tuple.elem1.723]
|
||||
// CHECK:STDOUT: %.loc5_38.5: %i32 = bind_value %tuple.elem1.loc5_38.1
|
||||
// CHECK:STDOUT: %tuple.elem1.loc5_38.2: ref %i32 = tuple_access %tuple.elem0.loc5_38.4, element1 [concrete = constants.%tuple.elem1.ae3]
|
||||
// CHECK:STDOUT: %.loc5_38.6: init %i32 = initialize_from %.loc5_38.5 to %tuple.elem1.loc5_38.2
|
||||
// CHECK:STDOUT: %.loc5_38.7: init %tuple.type.154 = tuple_init (%.loc5_38.4, %.loc5_38.6) to %tuple.elem0.loc5_38.4
|
||||
// CHECK:STDOUT: %.loc5_38.8: init %tuple.type.154 = converted %tuple.elem0.loc5_38.1, %.loc5_38.7
|
||||
// CHECK:STDOUT: %tuple.elem1.loc5_38.3: ref %tuple.type.c2c = tuple_access %b_ref.ref, element1 [concrete = constants.%tuple.elem1.92b]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc5_38.6: ref %i32 = tuple_access %tuple.elem1.loc5_38.3, element0 [concrete = constants.%tuple.elem0.2ff]
|
||||
// CHECK:STDOUT: %.loc5_38.9: %i32 = bind_value %tuple.elem0.loc5_38.6
|
||||
// CHECK:STDOUT: %tuple.elem1.loc5_38.4: ref %tuple.type.c2c = tuple_access file.%b.var, element1 [concrete = constants.%tuple.elem1.4f3]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc5_38.7: ref %i32 = tuple_access %tuple.elem1.loc5_38.4, element0 [concrete = constants.%tuple.elem0.790]
|
||||
// CHECK:STDOUT: %.loc5_38.10: init %i32 = initialize_from %.loc5_38.9 to %tuple.elem0.loc5_38.7
|
||||
// CHECK:STDOUT: %tuple.elem1.loc5_38.5: ref %i32 = tuple_access %tuple.elem1.loc5_38.3, element1 [concrete = constants.%tuple.elem1.282]
|
||||
// CHECK:STDOUT: %.loc5_38.11: %i32 = bind_value %tuple.elem1.loc5_38.5
|
||||
// CHECK:STDOUT: %tuple.elem1.loc5_38.6: ref %i32 = tuple_access %tuple.elem1.loc5_38.4, element1 [concrete = constants.%tuple.elem1.822]
|
||||
// CHECK:STDOUT: %.loc5_38.12: init %i32 = initialize_from %.loc5_38.11 to %tuple.elem1.loc5_38.6
|
||||
// CHECK:STDOUT: %.loc5_38.13: init %tuple.type.c2c = tuple_init (%.loc5_38.10, %.loc5_38.12) to %tuple.elem1.loc5_38.4
|
||||
// CHECK:STDOUT: %.loc5_38.14: init %tuple.type.c2c = converted %tuple.elem1.loc5_38.3, %.loc5_38.13
|
||||
// CHECK:STDOUT: %.loc5_38.15: init %tuple.type.cfa = tuple_init (%.loc5_38.8, %.loc5_38.14) to file.%b.var
|
||||
// CHECK:STDOUT: %.loc5_1: init %tuple.type.cfa = converted %b_ref.ref, %.loc5_38.15
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc5_1
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Implicit.F [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %.loc6: ref %C.cf0 = splice_block file.%c.var [concrete = file.%c.var] {}
|
||||
// CHECK:STDOUT: %F.call: init %C.cf0 = call %F.ref() to %.loc6
|
||||
// CHECK:STDOUT: assign file.%c.var, %F.call
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @C(constants.%X) {
|
||||
// CHECK:STDOUT: %X => constants.%X
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @C(constants.%tuple) {
|
||||
// CHECK:STDOUT: %X => constants.%tuple
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_bad_type.impl.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
|
||||
// CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.c2c: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.37f: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_2.d0d: %i32 = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%int_1.47b, %int_2.d0d) [concrete]
|
||||
// CHECK:STDOUT: %C.cf0: type = class_type @C, @C(%tuple) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Implicit.a_ref = import_ref Implicit//default, a_ref, unloaded
|
||||
// CHECK:STDOUT: %Implicit.b_ref = import_ref Implicit//default, b_ref, unloaded
|
||||
// CHECK:STDOUT: %Implicit.C: %C.type = import_ref Implicit//default, C, loaded [concrete = constants.%C.generic]
|
||||
// CHECK:STDOUT: %Implicit.F: %F.type = import_ref Implicit//default, F, loaded [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %Core.ece: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Implicit.import_ref.48d: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)]
|
||||
// CHECK:STDOUT: %Implicit.import_ref.8f2: <witness> = import_ref Implicit//default, loc7_26, loaded [concrete = constants.%complete_type.357]
|
||||
// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1463 [no loc], unloaded
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .a_ref = imports.%Implicit.a_ref
|
||||
// CHECK:STDOUT: .b_ref = imports.%Implicit.b_ref
|
||||
// CHECK:STDOUT: .C = imports.%Implicit.C
|
||||
// CHECK:STDOUT: .F = imports.%Implicit.F
|
||||
// CHECK:STDOUT: .Core = imports.%Core.ece
|
||||
// CHECK:STDOUT: .c_bad = %c_bad
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Implicit.import = import Implicit
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c_bad.patt: <error> = binding_pattern c_bad [concrete]
|
||||
// CHECK:STDOUT: %c_bad.var_patt: <error> = var_pattern %c_bad.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c_bad.var: ref <error> = var %c_bad.var_patt [concrete = <error>]
|
||||
// CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Implicit.C [concrete = constants.%C.generic]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
|
||||
// CHECK:STDOUT: %.loc12: %tuple.type.37f = tuple_literal (%int_1, %int_2, %int_3)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c_bad: <error> = bind_name c_bad, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.48d: %tuple.type.c2c) [from "implicit.carbon"] {
|
||||
// CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: complete_type_witness = imports.%Implicit.import_ref.8f2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = imports.%Implicit.import_ref.964
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F [from "implicit.carbon"];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Implicit.F [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %.loc12: ref %C.cf0 = temporary_storage
|
||||
// CHECK:STDOUT: %F.call: init %C.cf0 = call %F.ref() to %.loc12
|
||||
// CHECK:STDOUT: assign file.%c_bad.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @C(constants.%X) {
|
||||
// CHECK:STDOUT: %X => constants.%X
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @C(constants.%tuple) {
|
||||
// CHECK:STDOUT: %X => constants.%tuple
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_bad_value.impl.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.595: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.595 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.9a6: type = fn_type @Convert.2, @impl.a8d(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.458: %Convert.type.9a6 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
|
||||
// CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.c2c: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic]
|
||||
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.b9e: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.ea0: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.2ce: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.1ad, @impl.a8d(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.e14: type = fn_type @Convert.2, @impl.a8d(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.4cb: %Convert.type.e14 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.2ce) [concrete]
|
||||
// CHECK:STDOUT: %.940: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.a00: <bound method> = bound_method %int_3.1ba, %Convert.4cb [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.4cb, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.fc5: <bound method> = bound_method %int_3.1ba, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_3.d47: %i32 = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.694: <bound method> = bound_method %int_4.0c1, %Convert.4cb [concrete]
|
||||
// CHECK:STDOUT: %bound_method.b6e: <bound method> = bound_method %int_4.0c1, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_4.ea3: %i32 = int_value 4 [concrete]
|
||||
// CHECK:STDOUT: %tuple.5de: %tuple.type.c2c = tuple_value (%int_3.d47, %int_4.ea3) [concrete]
|
||||
// CHECK:STDOUT: %C.ed5: type = class_type @C, @C(%tuple.5de) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.b05: type = pattern_type %C.ed5 [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_2: %i32 = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %int_1: %i32 = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.56c: %tuple.type.c2c = tuple_value (%int_1, %int_2) [concrete]
|
||||
// CHECK:STDOUT: %C.cf0: type = class_type @C, @C(%tuple.56c) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Implicit.a_ref = import_ref Implicit//default, a_ref, unloaded
|
||||
// CHECK:STDOUT: %Implicit.b_ref = import_ref Implicit//default, b_ref, unloaded
|
||||
// CHECK:STDOUT: %Implicit.C: %C.type = import_ref Implicit//default, C, loaded [concrete = constants.%C.generic]
|
||||
// CHECK:STDOUT: %Implicit.F: %F.type = import_ref Implicit//default, F, loaded [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %Core.ece: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Implicit.import_ref.773: @impl.a8d.%Convert.type (%Convert.type.9a6) = import_ref Implicit//default, inst119 [indirect], loaded [symbolic = @impl.a8d.%Convert (constants.%Convert.458)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.1ad = impl_witness_table (%Implicit.import_ref.773), @impl.a8d [concrete]
|
||||
// CHECK:STDOUT: %Implicit.import_ref.48d: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)]
|
||||
// CHECK:STDOUT: %Implicit.import_ref.8f2: <witness> = import_ref Implicit//default, loc7_26, loaded [concrete = constants.%complete_type.357]
|
||||
// CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1463 [no loc], unloaded
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.595 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .a_ref = imports.%Implicit.a_ref
|
||||
// CHECK:STDOUT: .b_ref = imports.%Implicit.b_ref
|
||||
// CHECK:STDOUT: .C = imports.%Implicit.C
|
||||
// CHECK:STDOUT: .F = imports.%Implicit.F
|
||||
// CHECK:STDOUT: .Core = imports.%Core.ece
|
||||
// CHECK:STDOUT: .c_bad = %c_bad
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Implicit.import = import Implicit
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c_bad.patt: %pattern_type.b05 = binding_pattern c_bad [concrete]
|
||||
// CHECK:STDOUT: %c_bad.var_patt: %pattern_type.b05 = var_pattern %c_bad.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c_bad.var: ref %C.ed5 = var %c_bad.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc11_20.1: type = splice_block %C [concrete = constants.%C.ed5] {
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Implicit.C [concrete = constants.%C.generic]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
|
||||
// CHECK:STDOUT: %.loc11_19.1: %tuple.type.f94 = tuple_literal (%int_3, %int_4)
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_19.1: %.940 = impl_witness_access constants.%ImplicitAs.impl_witness.2ce, element0 [concrete = constants.%Convert.4cb]
|
||||
// CHECK:STDOUT: %bound_method.loc11_19.1: <bound method> = bound_method %int_3, %impl.elem0.loc11_19.1 [concrete = constants.%Convert.bound.a00]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_19.1: <specific function> = specific_function %impl.elem0.loc11_19.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_19.2: <bound method> = bound_method %int_3, %specific_fn.loc11_19.1 [concrete = constants.%bound_method.fc5]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_19.1: init %i32 = call %bound_method.loc11_19.2(%int_3) [concrete = constants.%int_3.d47]
|
||||
// CHECK:STDOUT: %.loc11_19.2: %i32 = value_of_initializer %int.convert_checked.loc11_19.1 [concrete = constants.%int_3.d47]
|
||||
// CHECK:STDOUT: %.loc11_19.3: %i32 = converted %int_3, %.loc11_19.2 [concrete = constants.%int_3.d47]
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_19.2: %.940 = impl_witness_access constants.%ImplicitAs.impl_witness.2ce, element0 [concrete = constants.%Convert.4cb]
|
||||
// CHECK:STDOUT: %bound_method.loc11_19.3: <bound method> = bound_method %int_4, %impl.elem0.loc11_19.2 [concrete = constants.%Convert.bound.694]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_19.2: <specific function> = specific_function %impl.elem0.loc11_19.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_19.4: <bound method> = bound_method %int_4, %specific_fn.loc11_19.2 [concrete = constants.%bound_method.b6e]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_19.2: init %i32 = call %bound_method.loc11_19.4(%int_4) [concrete = constants.%int_4.ea3]
|
||||
// CHECK:STDOUT: %.loc11_19.4: %i32 = value_of_initializer %int.convert_checked.loc11_19.2 [concrete = constants.%int_4.ea3]
|
||||
// CHECK:STDOUT: %.loc11_19.5: %i32 = converted %int_4, %.loc11_19.4 [concrete = constants.%int_4.ea3]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%.loc11_19.3, %.loc11_19.5) [concrete = constants.%tuple.5de]
|
||||
// CHECK:STDOUT: %.loc11_20.2: %tuple.type.c2c = converted %.loc11_19.1, %tuple [concrete = constants.%tuple.5de]
|
||||
// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.5de) [concrete = constants.%C.ed5]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c_bad: ref %C.ed5 = bind_name c_bad, %c_bad.var [concrete = %c_bad.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.48d: %tuple.type.c2c) [from "implicit.carbon"] {
|
||||
// CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: complete_type_witness = imports.%Implicit.import_ref.8f2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = imports.%Implicit.import_ref.964
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F [from "implicit.carbon"];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Implicit.F [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %.loc11_26: ref %C.cf0 = temporary_storage
|
||||
// CHECK:STDOUT: %F.call: init %C.cf0 = call %F.ref() to %.loc11_26
|
||||
// CHECK:STDOUT: %.loc11_1: %C.ed5 = converted %F.call, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: assign file.%c_bad.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @C(constants.%X) {
|
||||
// CHECK:STDOUT: %X => constants.%X
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @C(constants.%tuple.5de) {
|
||||
// CHECK:STDOUT: %X => constants.%tuple.5de
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @C(constants.%tuple.56c) {
|
||||
// CHECK:STDOUT: %X => constants.%tuple.56c
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -0,0 +1,78 @@
|
||||
// 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
|
||||
//
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=only
|
||||
// INCLUDE-FILE: toolchain/testing/min_prelude/convert.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/tuple/min_prelude/class_tuples.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/min_prelude/class_tuples.carbon
|
||||
|
||||
// Versus the no_prelude basics.carbon, this tests some interactions with
|
||||
// `class`.
|
||||
|
||||
// --- fail_element_type_mismatch.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class C {}
|
||||
class D {}
|
||||
|
||||
var c: C;
|
||||
var d: D;
|
||||
// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert expression of type `C` to `C*` [ConversionFailure]
|
||||
// CHECK:STDERR: var x: (C*, C*) = (c, d);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+4]]:19: note: type `C` does not implement interface `Core.ImplicitAs(C*)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: var x: (C*, C*) = (c, d);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR:
|
||||
var x: (C*, C*) = (c, d);
|
||||
|
||||
// --- fail_nested_incomplete.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class Complete {}
|
||||
class Incomplete;
|
||||
|
||||
// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+7]]:8: error: binding pattern has incomplete type `(Complete, Incomplete)` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: var t: (Complete, Incomplete);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class Incomplete;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var t: (Complete, Incomplete);
|
||||
|
||||
var p: Incomplete* = &t[1];
|
||||
|
||||
// --- fail_type_assign.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class C {}
|
||||
|
||||
// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+7]]:16: error: cannot implicitly convert expression of type `type` to `C` [ConversionFailure]
|
||||
// CHECK:STDERR: var x: (C, ) = (C, );
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+4]]:16: note: type `type` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: var x: (C, ) = (C, );
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
var x: (C, ) = (C, );
|
||||
|
||||
// --- fail_value_as_type.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class C {}
|
||||
|
||||
var c: C;
|
||||
// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+7]]:8: error: cannot implicitly convert non-type value of type `C` to `type` [ConversionFailureNonTypeToFacet]
|
||||
// CHECK:STDERR: var x: c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+4]]:8: note: type `C` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: var x: c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var x: c;
|
||||
@@ -0,0 +1,373 @@
|
||||
// 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
|
||||
//
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=only
|
||||
// INCLUDE-FILE: toolchain/testing/min_prelude/int.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/tuple/min_prelude/element_access.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/min_prelude/element_access.carbon
|
||||
|
||||
// --- basics.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
var a: (i32,) = (42,);
|
||||
var b: (i32,) = a;
|
||||
//@dump-sem-ir-begin
|
||||
var c: i32 = b.0;
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// --- index_not_literal.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
var a: ((), i32) = ((), 34);
|
||||
//@dump-sem-ir-begin
|
||||
var b: i32 = a.({.index = 1}.index);
|
||||
var c: () = a.(0 as i32);
|
||||
var d: i32 = a.({.index = 1 as i32}.index);
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// --- return_value_access.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() -> (i32,) { return (0,); }
|
||||
|
||||
fn Run() -> i32 {
|
||||
//@dump-sem-ir-begin
|
||||
return F().0;
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// --- fail_access_error.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
var a: (i32, i32) = (12, 6);
|
||||
// CHECK:STDERR: fail_access_error.carbon:[[@LINE+4]]:17: error: name `oops` not found [NameNotFound]
|
||||
// CHECK:STDERR: var b: i32 = a.(oops);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = a.(oops);
|
||||
|
||||
// --- fail_empty_access.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() {}
|
||||
|
||||
fn Run() {
|
||||
// CHECK:STDERR: fail_empty_access.carbon:[[@LINE+4]]:3: error: tuple element index `0` is past the end of type `()` [TupleIndexOutOfBounds]
|
||||
// CHECK:STDERR: F().0;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
F().0;
|
||||
}
|
||||
|
||||
// --- fail_large_index.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
var a: (i32,) = (12,);
|
||||
var b: (i32,) = a;
|
||||
// CHECK:STDERR: fail_large_index.carbon:[[@LINE+4]]:14: error: tuple element index `1` is past the end of type `(i32,)` [TupleIndexOutOfBounds]
|
||||
// CHECK:STDERR: var c: i32 = b.1;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
var c: i32 = b.1;
|
||||
// CHECK:STDERR: fail_large_index.carbon:[[@LINE+4]]:14: error: tuple element index `2147483647` is past the end of type `(i32,)` [TupleIndexOutOfBounds]
|
||||
// CHECK:STDERR: var d: i32 = b.(0x7FFF_FFFF);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var d: i32 = b.(0x7FFF_FFFF);
|
||||
|
||||
// --- fail_negative_indexing.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
var a: (i32, i32) = (12, 6);
|
||||
// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+4]]:14: error: tuple element index `-10` is past the end of type `(i32, i32)` [TupleIndexOutOfBounds]
|
||||
// CHECK:STDERR: var b: i32 = a.(-10);
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = a.(-10);
|
||||
|
||||
// --- fail_non_deterministic_type.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
var a: (i32, i32) = (2, 3);
|
||||
var b: i32 = 0;
|
||||
// CHECK:STDERR: fail_non_deterministic_type.carbon:[[@LINE+11]]:17: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: var c: i32 = a.(b);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: include_files/int.carbon:32:3: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR: fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_non_deterministic_type.carbon:[[@LINE+4]]:14: error: tuple index must be a constant [TupleIndexNotConstant]
|
||||
// CHECK:STDERR: var c: i32 = a.(b);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
var c: i32 = a.(b);
|
||||
|
||||
// --- fail_non_int_indexing.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
var a: (i32, i32) = (12, 6);
|
||||
// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+7]]:17: error: cannot implicitly convert expression of type `f64` to `Core.IntLiteral` [ConversionFailure]
|
||||
// CHECK:STDERR: var b: i32 = a.(2.6);
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+4]]:17: note: type `f64` does not implement interface `Core.ImplicitAs(Core.IntLiteral)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: var b: i32 = a.(2.6);
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = a.(2.6);
|
||||
|
||||
// --- fail_non_tuple_access.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn Main() {
|
||||
var non_tuple: array(i32, 2) = (5, 5);
|
||||
// CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+4]]:20: error: type `array(i32, 2)` does not support tuple indexing; only tuples can be indexed that way [TupleIndexOnANonTupleType]
|
||||
// CHECK:STDERR: var first: i32 = non_tuple.0;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var first: i32 = non_tuple.0;
|
||||
}
|
||||
|
||||
// --- fail_out_of_bound_access.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
var a: (i32, i32) = (12, 6);
|
||||
// CHECK:STDERR: fail_out_of_bound_access.carbon:[[@LINE+4]]:14: error: tuple element index `2` is past the end of type `(i32, i32)` [TupleIndexOutOfBounds]
|
||||
// CHECK:STDERR: var b: i32 = a.2;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = a.2;
|
||||
|
||||
// --- fail_out_of_bound_not_literal.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
var a: (i32, i32) = (12, 34);
|
||||
// CHECK:STDERR: fail_out_of_bound_not_literal.carbon:[[@LINE+4]]:14: error: tuple element index `2` is past the end of type `(i32, i32)` [TupleIndexOutOfBounds]
|
||||
// CHECK:STDERR: var b: i32 = a.({.index = 2}.index);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = a.({.index = 2}.index);
|
||||
|
||||
// CHECK:STDOUT: --- basics.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.4d5: ref %i32 = tuple_access file.%b.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.7ce = binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %c.var_patt: %pattern_type.7ce = var_pattern %c.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %i32 = var %c.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %i32 = bind_name c, %c.var [concrete = %c.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %b.ref: ref %tuple.type.a1c = name_ref b, file.%b [concrete = file.%b.var]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc6: ref %i32 = tuple_access %b.ref, element0 [concrete = constants.%tuple.elem0.4d5]
|
||||
// CHECK:STDOUT: %.loc6: %i32 = bind_value %tuple.elem0.loc6
|
||||
// CHECK:STDOUT: assign file.%c.var, %.loc6
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- index_not_literal.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.0ce: type = tuple_type (%empty_tuple.type, %i32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %empty_tuple.type = tuple_access file.%a.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access file.%a.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
|
||||
// CHECK:STDOUT: %From: Core.IntLiteral = bind_symbolic_name From, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.708: type = fn_type @Convert.3, @impl.971(%From) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.c68: %Convert.type.708 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.062: type = fn_type @Convert.5, @impl.686(%To) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.527: %Convert.type.062 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.index.b1b: type = struct_type {.index: Core.IntLiteral} [concrete]
|
||||
// CHECK:STDOUT: %struct.972: %struct_type.index.b1b = struct_value (%int_1.5b8) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: %As.type.fd4: type = facet_type <@As, @As(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.4, @As(%i32) [concrete]
|
||||
// CHECK:STDOUT: %As.impl_witness.6b4: <witness> = impl_witness imports.%As.impl_witness_table.eb4, @impl.686(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.686(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %As.facet: %As.type.fd4 = facet_value Core.IntLiteral, (%As.impl_witness.6b4) [concrete]
|
||||
// CHECK:STDOUT: %.982: type = fn_type_with_self_type %Convert.type.99b, %As.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.129: <bound method> = bound_method %int_0.5c6, %Convert.197 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.aad: <specific function> = specific_function %Convert.197, @Convert.5(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.46b: <bound method> = bound_method %int_0.5c6, %Convert.specific_fn.aad [concrete]
|
||||
// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.a11: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.1d9, @impl.971(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.971(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet.f49: %ImplicitAs.type.2fd = facet_value %i32, (%ImplicitAs.impl_witness.a11) [concrete]
|
||||
// CHECK:STDOUT: %.0ea: type = fn_type_with_self_type %Convert.type.71e, %ImplicitAs.facet.f49 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.0fd: <bound method> = bound_method %int_0.6a9, %Convert.960 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.8a8: <specific function> = specific_function %Convert.960, @Convert.3(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.4b5: <bound method> = bound_method %int_0.6a9, %Convert.specific_fn.8a8 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.c1b: <bound method> = bound_method %int_1.5b8, %Convert.197 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.082: <bound method> = bound_method %int_1.5b8, %Convert.specific_fn.aad [concrete]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.index.6ea: type = struct_type {.index: %i32} [concrete]
|
||||
// CHECK:STDOUT: %struct.63a: %struct_type.index.6ea = struct_value (%int_1.5d2) [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.faf: <bound method> = bound_method %int_1.5d2, %Convert.960 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.711: <bound method> = bound_method %int_1.5d2, %Convert.specific_fn.8a8 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core.import_ref.85c: @impl.971.%Convert.type (%Convert.type.708) = import_ref Core//prelude, loc32_44, loaded [symbolic = @impl.971.%Convert (constants.%Convert.c68)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.1d9 = impl_witness_table (%Core.import_ref.85c), @impl.971 [concrete]
|
||||
// CHECK:STDOUT: %Core.import_ref.78a: @impl.686.%Convert.type (%Convert.type.062) = import_ref Core//prelude, loc37_39, loaded [symbolic = @impl.686.%Convert (constants.%Convert.527)]
|
||||
// CHECK:STDOUT: %As.impl_witness_table.eb4 = impl_witness_table (%Core.import_ref.78a), @impl.686 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.7ce = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.7ce = var_pattern %b.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc5: type = splice_block %i32.loc5 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.cb1 = binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %c.var_patt: %pattern_type.cb1 = var_pattern %c.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %empty_tuple.type = var %c.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc6_9.1: type = splice_block %.loc6_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc6_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc6_9.3: type = converted %.loc6_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %empty_tuple.type = bind_name c, %c.var [concrete = %c.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %d.patt: %pattern_type.7ce = binding_pattern d [concrete]
|
||||
// CHECK:STDOUT: %d.var_patt: %pattern_type.7ce = var_pattern %d.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d.var: ref %i32 = var %d.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc7: type = splice_block %i32.loc7 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d: ref %i32 = bind_name d, %d.var [concrete = %d.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %a.ref.loc5: ref %tuple.type.0ce = name_ref a, file.%a [concrete = file.%a.var]
|
||||
// CHECK:STDOUT: %int_1.loc5: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc5_28.1: %struct_type.index.b1b = struct_literal (%int_1.loc5)
|
||||
// CHECK:STDOUT: %struct.loc5: %struct_type.index.b1b = struct_value (%int_1.loc5) [concrete = constants.%struct.972]
|
||||
// CHECK:STDOUT: %.loc5_28.2: %struct_type.index.b1b = converted %.loc5_28.1, %struct.loc5 [concrete = constants.%struct.972]
|
||||
// CHECK:STDOUT: %.loc5_29: Core.IntLiteral = struct_access %.loc5_28.2, element0 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc5: ref %i32 = tuple_access %a.ref.loc5, element1 [concrete = constants.%tuple.elem1]
|
||||
// CHECK:STDOUT: %.loc5_15: %i32 = bind_value %tuple.elem1.loc5
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc5_15
|
||||
// CHECK:STDOUT: %a.ref.loc6: ref %tuple.type.0ce = name_ref a, file.%a [concrete = file.%a.var]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_18.1: %.982 = impl_witness_access constants.%As.impl_witness.6b4, element0 [concrete = constants.%Convert.197]
|
||||
// CHECK:STDOUT: %bound_method.loc6_18.1: <bound method> = bound_method %int_0, %impl.elem0.loc6_18.1 [concrete = constants.%Convert.bound.129]
|
||||
// CHECK:STDOUT: %specific_fn.loc6_18.1: <specific function> = specific_function %impl.elem0.loc6_18.1, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn.aad]
|
||||
// CHECK:STDOUT: %bound_method.loc6_18.2: <bound method> = bound_method %int_0, %specific_fn.loc6_18.1 [concrete = constants.%bound_method.46b]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc6_18.1: init %i32 = call %bound_method.loc6_18.2(%int_0) [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18.1 [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_0, %.loc6_18.1 [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_18.2: %.0ea = impl_witness_access constants.%ImplicitAs.impl_witness.a11, element0 [concrete = constants.%Convert.960]
|
||||
// CHECK:STDOUT: %bound_method.loc6_18.3: <bound method> = bound_method %.loc6_18.2, %impl.elem0.loc6_18.2 [concrete = constants.%Convert.bound.0fd]
|
||||
// CHECK:STDOUT: %specific_fn.loc6_18.2: <specific function> = specific_function %impl.elem0.loc6_18.2, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.8a8]
|
||||
// CHECK:STDOUT: %bound_method.loc6_18.4: <bound method> = bound_method %.loc6_18.2, %specific_fn.loc6_18.2 [concrete = constants.%bound_method.4b5]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc6_18.2: init Core.IntLiteral = call %bound_method.loc6_18.4(%.loc6_18.2) [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %.loc6_18.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc6_18.2 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %.loc6_18.4: Core.IntLiteral = converted %.loc6_18.2, %.loc6_18.3 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc6: ref %empty_tuple.type = tuple_access %a.ref.loc6, element0 [concrete = constants.%tuple.elem0]
|
||||
// CHECK:STDOUT: %.loc6_14: init %empty_tuple.type = tuple_init () to file.%c.var [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc6_1: init %empty_tuple.type = converted %tuple.elem0.loc6, %.loc6_14 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: assign file.%c.var, %.loc6_1
|
||||
// CHECK:STDOUT: %a.ref.loc7: ref %tuple.type.0ce = name_ref a, file.%a [concrete = file.%a.var]
|
||||
// CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_29: %.982 = impl_witness_access constants.%As.impl_witness.6b4, element0 [concrete = constants.%Convert.197]
|
||||
// CHECK:STDOUT: %bound_method.loc7_29.1: <bound method> = bound_method %int_1.loc7, %impl.elem0.loc7_29 [concrete = constants.%Convert.bound.c1b]
|
||||
// CHECK:STDOUT: %specific_fn.loc7_29: <specific function> = specific_function %impl.elem0.loc7_29, @Convert.5(constants.%int_32) [concrete = constants.%Convert.specific_fn.aad]
|
||||
// CHECK:STDOUT: %bound_method.loc7_29.2: <bound method> = bound_method %int_1.loc7, %specific_fn.loc7_29 [concrete = constants.%bound_method.082]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc7_29: init %i32 = call %bound_method.loc7_29.2(%int_1.loc7) [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc7_29.1: %i32 = value_of_initializer %int.convert_checked.loc7_29 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc7_29.2: %i32 = converted %int_1.loc7, %.loc7_29.1 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc7_35.1: %struct_type.index.6ea = struct_literal (%.loc7_29.2)
|
||||
// CHECK:STDOUT: %struct.loc7: %struct_type.index.6ea = struct_value (%.loc7_29.2) [concrete = constants.%struct.63a]
|
||||
// CHECK:STDOUT: %.loc7_35.2: %struct_type.index.6ea = converted %.loc7_35.1, %struct.loc7 [concrete = constants.%struct.63a]
|
||||
// CHECK:STDOUT: %.loc7_36.1: %i32 = struct_access %.loc7_35.2, element0 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_36: %.0ea = impl_witness_access constants.%ImplicitAs.impl_witness.a11, element0 [concrete = constants.%Convert.960]
|
||||
// CHECK:STDOUT: %bound_method.loc7_36.1: <bound method> = bound_method %.loc7_36.1, %impl.elem0.loc7_36 [concrete = constants.%Convert.bound.faf]
|
||||
// CHECK:STDOUT: %specific_fn.loc7_36: <specific function> = specific_function %impl.elem0.loc7_36, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn.8a8]
|
||||
// CHECK:STDOUT: %bound_method.loc7_36.2: <bound method> = bound_method %.loc7_36.1, %specific_fn.loc7_36 [concrete = constants.%bound_method.711]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc7_36: init Core.IntLiteral = call %bound_method.loc7_36.2(%.loc7_36.1) [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc7_36.2: Core.IntLiteral = value_of_initializer %int.convert_checked.loc7_36 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc7_36.3: Core.IntLiteral = converted %.loc7_36.1, %.loc7_36.2 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc7: ref %i32 = tuple_access %a.ref.loc7, element1 [concrete = constants.%tuple.elem1]
|
||||
// CHECK:STDOUT: %.loc7_15: %i32 = bind_value %tuple.elem1.loc7
|
||||
// CHECK:STDOUT: assign file.%d.var, %.loc7_15
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- return_value_access.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Run() -> %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %F.call: init %tuple.type.a1c = call %F.ref()
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %.loc7_12.1: ref %tuple.type.a1c = temporary_storage
|
||||
// CHECK:STDOUT: %.loc7_12.2: ref %tuple.type.a1c = temporary %.loc7_12.1, %F.call
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %.loc7_12.2, element0
|
||||
// CHECK:STDOUT: %.loc7_13: %i32 = bind_value %tuple.elem0
|
||||
// CHECK:STDOUT: return %.loc7_13
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -0,0 +1,248 @@
|
||||
// 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
|
||||
//
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=only
|
||||
// INCLUDE-FILE: toolchain/testing/min_prelude/int.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/tuple/min_prelude/import.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/min_prelude/import.carbon
|
||||
|
||||
// --- implicit.carbon
|
||||
|
||||
package Implicit;
|
||||
|
||||
var a_ref: (i32,) = (0,);
|
||||
var b_ref: (((i32,), i32), (i32, i32)) = (((0,), 1), (2, 3));
|
||||
|
||||
class C(X:! (i32, i32)) {}
|
||||
|
||||
fn F() -> C((1, 2));
|
||||
|
||||
// --- implicit.impl.carbon
|
||||
|
||||
impl package Implicit;
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
var a: (i32,) = a_ref;
|
||||
var b: (((i32,), i32), (i32, i32)) = b_ref;
|
||||
var c: C((1, 2)) = F();
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// --- fail_bad_type.impl.carbon
|
||||
|
||||
impl package Implicit;
|
||||
|
||||
// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+8]]:14: error: cannot initialize tuple of 2 elements from tuple with 3 elements [TupleInitElementCountMismatch]
|
||||
// CHECK:STDERR: var c_bad: C((1, 2, 3)) = F();
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: implicit.carbon:7:9: note: initializing generic parameter `X` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: class C(X:! (i32, i32)) {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var c_bad: C((1, 2, 3)) = F();
|
||||
|
||||
// --- fail_bad_value.impl.carbon
|
||||
|
||||
impl package Implicit;
|
||||
|
||||
// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+7]]:1: error: cannot implicitly convert expression of type `C((1, 2))` to `C((3, 4))` [ConversionFailure]
|
||||
// CHECK:STDERR: var c_bad: C((3, 4)) = F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+4]]:1: note: type `C((1, 2))` does not implement interface `Core.ImplicitAs(C((3, 4)))` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: var c_bad: C((3, 4)) = F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var c_bad: C((3, 4)) = F();
|
||||
|
||||
// CHECK:STDOUT: --- implicit.impl.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.9a6: type = fn_type @Convert.2, @impl.a8d(%To) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.458: %Convert.type.9a6 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.dd4: type = tuple_type (%i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.2e8: type = pattern_type %tuple.type.dd4 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.994: ref %i32 = tuple_access imports.%a_ref.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.8c7: type = tuple_type (%tuple.type.85c, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.58c: type = tuple_type (%tuple.type.8c7, %tuple.type.24b) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.154: type = tuple_type (%tuple.type.dd4, %i32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.c2c: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.cfa: type = tuple_type (%tuple.type.154, %tuple.type.c2c) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.ab9: type = pattern_type %tuple.type.cfa [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.693: ref %tuple.type.154 = tuple_access imports.%b_ref.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.76a: ref %tuple.type.154 = tuple_access file.%b.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.4c9: ref %tuple.type.dd4 = tuple_access %tuple.elem0.693, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.6fd: ref %tuple.type.dd4 = tuple_access %tuple.elem0.76a, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.390: ref %i32 = tuple_access %tuple.elem0.4c9, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.723: ref %i32 = tuple_access %tuple.elem0.693, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.ae3: ref %i32 = tuple_access %tuple.elem0.76a, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.92b: ref %tuple.type.c2c = tuple_access imports.%b_ref.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.4f3: ref %tuple.type.c2c = tuple_access file.%b.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.2ff: ref %i32 = tuple_access %tuple.elem1.92b, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.790: ref %i32 = tuple_access %tuple.elem1.4f3, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.282: ref %i32 = tuple_access %tuple.elem1.92b, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.822: ref %i32 = tuple_access %tuple.elem1.4f3, element1 [concrete]
|
||||
// CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
|
||||
// CHECK:STDOUT: %C.generic: %C.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.b9e: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.ea0: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.2ce: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.1ad, @impl.a8d(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.e14: type = fn_type @Convert.2, @impl.a8d(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.4cb: %Convert.type.e14 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.2ce) [concrete]
|
||||
// CHECK:STDOUT: %.940: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.dc5: <bound method> = bound_method %int_1.5b8, %Convert.4cb [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.4cb, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.c37: <bound method> = bound_method %int_1.5b8, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.30f: <bound method> = bound_method %int_2.ecc, %Convert.4cb [concrete]
|
||||
// CHECK:STDOUT: %bound_method.62b: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_2.d0d: %i32 = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%int_1.47b, %int_2.d0d) [concrete]
|
||||
// CHECK:STDOUT: %C.cf0: type = class_type @C, @C(%tuple) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7e2: type = pattern_type %C.cf0 [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Implicit.a_ref: ref %tuple.type.dd4 = import_ref Implicit//default, a_ref, loaded [concrete = %a_ref.var]
|
||||
// CHECK:STDOUT: %Implicit.b_ref: ref %tuple.type.cfa = import_ref Implicit//default, b_ref, loaded [concrete = %b_ref.var]
|
||||
// CHECK:STDOUT: %Implicit.C: %C.type = import_ref Implicit//default, C, loaded [concrete = constants.%C.generic]
|
||||
// CHECK:STDOUT: %Implicit.F: %F.type = import_ref Implicit//default, F, loaded [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %Implicit.import_ref.773: @impl.a8d.%Convert.type (%Convert.type.9a6) = import_ref Implicit//default, inst119 [indirect], loaded [symbolic = @impl.a8d.%Convert (constants.%Convert.458)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.1ad = impl_witness_table (%Implicit.import_ref.773), @impl.a8d [concrete]
|
||||
// CHECK:STDOUT: %a_ref.patt: %pattern_type.2e8 = binding_pattern a_ref [concrete]
|
||||
// CHECK:STDOUT: %a_ref.var_patt: %pattern_type.2e8 = var_pattern %a_ref.patt [concrete]
|
||||
// CHECK:STDOUT: %a_ref.var: ref %tuple.type.dd4 = var %a_ref.var_patt [concrete]
|
||||
// CHECK:STDOUT: %b_ref.patt: %pattern_type.ab9 = binding_pattern b_ref [concrete]
|
||||
// CHECK:STDOUT: %b_ref.var_patt: %pattern_type.ab9 = var_pattern %b_ref.patt [concrete]
|
||||
// CHECK:STDOUT: %b_ref.var: ref %tuple.type.cfa = var %b_ref.var_patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.2e8 = binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.2e8 = var_pattern %a.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %tuple.type.dd4 = var %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc5_13.1: type = splice_block %.loc5_13.3 [concrete = constants.%tuple.type.dd4] {
|
||||
// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_13.2: %tuple.type.85c = tuple_literal (%i32.loc5)
|
||||
// CHECK:STDOUT: %.loc5_13.3: type = converted %.loc5_13.2, constants.%tuple.type.dd4 [concrete = constants.%tuple.type.dd4]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %tuple.type.dd4 = bind_name a, %a.var [concrete = %a.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.ab9 = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.ab9 = var_pattern %b.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %tuple.type.cfa = var %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc6_34.1: type = splice_block %.loc6_34.6 [concrete = constants.%tuple.type.cfa] {
|
||||
// CHECK:STDOUT: %int_32.loc6_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc6_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc6_15: %tuple.type.85c = tuple_literal (%i32.loc6_11)
|
||||
// CHECK:STDOUT: %int_32.loc6_18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc6_18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc6_21: %tuple.type.8c7 = tuple_literal (%.loc6_15, %i32.loc6_18)
|
||||
// CHECK:STDOUT: %int_32.loc6_25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc6_25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc6_30: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc6_30: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc6_33: %tuple.type.24b = tuple_literal (%i32.loc6_25, %i32.loc6_30)
|
||||
// CHECK:STDOUT: %.loc6_34.2: %tuple.type.58c = tuple_literal (%.loc6_21, %.loc6_33)
|
||||
// CHECK:STDOUT: %.loc6_34.3: type = converted %.loc6_15, constants.%tuple.type.dd4 [concrete = constants.%tuple.type.dd4]
|
||||
// CHECK:STDOUT: %.loc6_34.4: type = converted %.loc6_21, constants.%tuple.type.154 [concrete = constants.%tuple.type.154]
|
||||
// CHECK:STDOUT: %.loc6_34.5: type = converted %.loc6_33, constants.%tuple.type.c2c [concrete = constants.%tuple.type.c2c]
|
||||
// CHECK:STDOUT: %.loc6_34.6: type = converted %.loc6_34.2, constants.%tuple.type.cfa [concrete = constants.%tuple.type.cfa]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %tuple.type.cfa = bind_name b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.7e2 = binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %c.var_patt: %pattern_type.7e2 = var_pattern %c.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %C.cf0 = var %c.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc7_16.1: type = splice_block %C [concrete = constants.%C.cf0] {
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Implicit.C [concrete = constants.%C.generic]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc7_15.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2)
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_15.1: %.940 = impl_witness_access constants.%ImplicitAs.impl_witness.2ce, element0 [concrete = constants.%Convert.4cb]
|
||||
// CHECK:STDOUT: %bound_method.loc7_15.1: <bound method> = bound_method %int_1, %impl.elem0.loc7_15.1 [concrete = constants.%Convert.bound.dc5]
|
||||
// CHECK:STDOUT: %specific_fn.loc7_15.1: <specific function> = specific_function %impl.elem0.loc7_15.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc7_15.2: <bound method> = bound_method %int_1, %specific_fn.loc7_15.1 [concrete = constants.%bound_method.c37]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc7_15.1: init %i32 = call %bound_method.loc7_15.2(%int_1) [concrete = constants.%int_1.47b]
|
||||
// CHECK:STDOUT: %.loc7_15.2: %i32 = value_of_initializer %int.convert_checked.loc7_15.1 [concrete = constants.%int_1.47b]
|
||||
// CHECK:STDOUT: %.loc7_15.3: %i32 = converted %int_1, %.loc7_15.2 [concrete = constants.%int_1.47b]
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_15.2: %.940 = impl_witness_access constants.%ImplicitAs.impl_witness.2ce, element0 [concrete = constants.%Convert.4cb]
|
||||
// CHECK:STDOUT: %bound_method.loc7_15.3: <bound method> = bound_method %int_2, %impl.elem0.loc7_15.2 [concrete = constants.%Convert.bound.30f]
|
||||
// CHECK:STDOUT: %specific_fn.loc7_15.2: <specific function> = specific_function %impl.elem0.loc7_15.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc7_15.4: <bound method> = bound_method %int_2, %specific_fn.loc7_15.2 [concrete = constants.%bound_method.62b]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc7_15.2: init %i32 = call %bound_method.loc7_15.4(%int_2) [concrete = constants.%int_2.d0d]
|
||||
// CHECK:STDOUT: %.loc7_15.4: %i32 = value_of_initializer %int.convert_checked.loc7_15.2 [concrete = constants.%int_2.d0d]
|
||||
// CHECK:STDOUT: %.loc7_15.5: %i32 = converted %int_2, %.loc7_15.4 [concrete = constants.%int_2.d0d]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%.loc7_15.3, %.loc7_15.5) [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc7_16.2: %tuple.type.c2c = converted %.loc7_15.1, %tuple [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple) [concrete = constants.%C.cf0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %C.cf0 = bind_name c, %c.var [concrete = %c.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %a_ref.ref: ref %tuple.type.dd4 = name_ref a_ref, imports.%Implicit.a_ref [concrete = imports.%a_ref.var]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc5: ref %i32 = tuple_access %a_ref.ref, element0 [concrete = constants.%tuple.elem0.994]
|
||||
// CHECK:STDOUT: %.loc5_17.1: %i32 = bind_value %tuple.elem0.loc5
|
||||
// CHECK:STDOUT: %.loc5_17.2: init %tuple.type.dd4 = tuple_init (%.loc5_17.1) to file.%a.var
|
||||
// CHECK:STDOUT: %.loc5_1: init %tuple.type.dd4 = converted %a_ref.ref, %.loc5_17.2
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc5_1
|
||||
// CHECK:STDOUT: %b_ref.ref: ref %tuple.type.cfa = name_ref b_ref, imports.%Implicit.b_ref [concrete = imports.%b_ref.var]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc6_38.1: ref %tuple.type.154 = tuple_access %b_ref.ref, element0 [concrete = constants.%tuple.elem0.693]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc6_38.2: ref %tuple.type.dd4 = tuple_access %tuple.elem0.loc6_38.1, element0 [concrete = constants.%tuple.elem0.4c9]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc6_38.3: ref %i32 = tuple_access %tuple.elem0.loc6_38.2, element0 [concrete = constants.%tuple.elem0.390]
|
||||
// CHECK:STDOUT: %.loc6_38.1: %i32 = bind_value %tuple.elem0.loc6_38.3
|
||||
// CHECK:STDOUT: %tuple.elem0.loc6_38.4: ref %tuple.type.154 = tuple_access file.%b.var, element0 [concrete = constants.%tuple.elem0.76a]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc6_38.5: ref %tuple.type.dd4 = tuple_access %tuple.elem0.loc6_38.4, element0 [concrete = constants.%tuple.elem0.6fd]
|
||||
// CHECK:STDOUT: %.loc6_38.2: init %tuple.type.dd4 = tuple_init (%.loc6_38.1) to %tuple.elem0.loc6_38.5
|
||||
// CHECK:STDOUT: %.loc6_38.3: init %tuple.type.dd4 = converted %tuple.elem0.loc6_38.2, %.loc6_38.2
|
||||
// CHECK:STDOUT: %.loc6_38.4: init %tuple.type.dd4 = initialize_from %.loc6_38.3 to %tuple.elem0.loc6_38.5
|
||||
// CHECK:STDOUT: %tuple.elem1.loc6_38.1: ref %i32 = tuple_access %tuple.elem0.loc6_38.1, element1 [concrete = constants.%tuple.elem1.723]
|
||||
// CHECK:STDOUT: %.loc6_38.5: %i32 = bind_value %tuple.elem1.loc6_38.1
|
||||
// CHECK:STDOUT: %tuple.elem1.loc6_38.2: ref %i32 = tuple_access %tuple.elem0.loc6_38.4, element1 [concrete = constants.%tuple.elem1.ae3]
|
||||
// CHECK:STDOUT: %.loc6_38.6: init %i32 = initialize_from %.loc6_38.5 to %tuple.elem1.loc6_38.2
|
||||
// CHECK:STDOUT: %.loc6_38.7: init %tuple.type.154 = tuple_init (%.loc6_38.4, %.loc6_38.6) to %tuple.elem0.loc6_38.4
|
||||
// CHECK:STDOUT: %.loc6_38.8: init %tuple.type.154 = converted %tuple.elem0.loc6_38.1, %.loc6_38.7
|
||||
// CHECK:STDOUT: %tuple.elem1.loc6_38.3: ref %tuple.type.c2c = tuple_access %b_ref.ref, element1 [concrete = constants.%tuple.elem1.92b]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc6_38.6: ref %i32 = tuple_access %tuple.elem1.loc6_38.3, element0 [concrete = constants.%tuple.elem0.2ff]
|
||||
// CHECK:STDOUT: %.loc6_38.9: %i32 = bind_value %tuple.elem0.loc6_38.6
|
||||
// CHECK:STDOUT: %tuple.elem1.loc6_38.4: ref %tuple.type.c2c = tuple_access file.%b.var, element1 [concrete = constants.%tuple.elem1.4f3]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc6_38.7: ref %i32 = tuple_access %tuple.elem1.loc6_38.4, element0 [concrete = constants.%tuple.elem0.790]
|
||||
// CHECK:STDOUT: %.loc6_38.10: init %i32 = initialize_from %.loc6_38.9 to %tuple.elem0.loc6_38.7
|
||||
// CHECK:STDOUT: %tuple.elem1.loc6_38.5: ref %i32 = tuple_access %tuple.elem1.loc6_38.3, element1 [concrete = constants.%tuple.elem1.282]
|
||||
// CHECK:STDOUT: %.loc6_38.11: %i32 = bind_value %tuple.elem1.loc6_38.5
|
||||
// CHECK:STDOUT: %tuple.elem1.loc6_38.6: ref %i32 = tuple_access %tuple.elem1.loc6_38.4, element1 [concrete = constants.%tuple.elem1.822]
|
||||
// CHECK:STDOUT: %.loc6_38.12: init %i32 = initialize_from %.loc6_38.11 to %tuple.elem1.loc6_38.6
|
||||
// CHECK:STDOUT: %.loc6_38.13: init %tuple.type.c2c = tuple_init (%.loc6_38.10, %.loc6_38.12) to %tuple.elem1.loc6_38.4
|
||||
// CHECK:STDOUT: %.loc6_38.14: init %tuple.type.c2c = converted %tuple.elem1.loc6_38.3, %.loc6_38.13
|
||||
// CHECK:STDOUT: %.loc6_38.15: init %tuple.type.cfa = tuple_init (%.loc6_38.8, %.loc6_38.14) to file.%b.var
|
||||
// CHECK:STDOUT: %.loc6_1: init %tuple.type.cfa = converted %b_ref.ref, %.loc6_38.15
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc6_1
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Implicit.F [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %.loc7: ref %C.cf0 = splice_block file.%c.var [concrete = file.%c.var] {}
|
||||
// CHECK:STDOUT: %F.call: init %C.cf0 = call %F.ref() to %.loc7
|
||||
// CHECK:STDOUT: assign file.%c.var, %F.call
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -0,0 +1,245 @@
|
||||
// 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
|
||||
//
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=only
|
||||
// INCLUDE-FILE: toolchain/testing/min_prelude/int.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/tuple/min_prelude/in_place_tuple_init.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/min_prelude/in_place_tuple_init.carbon
|
||||
|
||||
// --- in_place_tuple_init.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() -> (i32, i32);
|
||||
|
||||
fn G() -> (i32, i32) {
|
||||
//@dump-sem-ir-begin
|
||||
var v: (i32, i32) = F();
|
||||
v = F();
|
||||
return F();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
fn H() -> i32 {
|
||||
//@dump-sem-ir-begin
|
||||
return G().0;
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// --- nested_tuple_in_place.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() -> (i32, i32, i32);
|
||||
|
||||
fn G() {
|
||||
//@dump-sem-ir-begin
|
||||
var v: ((i32, i32, i32), (i32, i32, i32)) = (F(), F());
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
fn H() {
|
||||
//@dump-sem-ir-begin
|
||||
var v: (i32, (i32, i32, i32), i32) = (1, F(), 2);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- in_place_tuple_init.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() -> %return.param: %tuple.type.d07 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: %pattern_type.511 = binding_pattern v [concrete]
|
||||
// CHECK:STDOUT: %v.var_patt: %pattern_type.511 = var_pattern %v.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v.var: ref %tuple.type.d07 = var %v.var_patt
|
||||
// CHECK:STDOUT: %F.ref.loc7: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %.loc7_3: ref %tuple.type.d07 = splice_block %v.var {}
|
||||
// CHECK:STDOUT: %F.call.loc7: init %tuple.type.d07 = call %F.ref.loc7() to %.loc7_3
|
||||
// CHECK:STDOUT: assign %v.var, %F.call.loc7
|
||||
// CHECK:STDOUT: %.loc7_19.1: type = splice_block %.loc7_19.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc7_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc7_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc7_16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc7_16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc7_19.2: %tuple.type.24b = tuple_literal (%i32.loc7_11, %i32.loc7_16)
|
||||
// CHECK:STDOUT: %.loc7_19.3: type = converted %.loc7_19.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref %tuple.type.d07 = bind_name v, %v.var
|
||||
// CHECK:STDOUT: %v.ref: ref %tuple.type.d07 = name_ref v, %v
|
||||
// CHECK:STDOUT: %F.ref.loc8: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %.loc8: ref %tuple.type.d07 = splice_block %v.ref {}
|
||||
// CHECK:STDOUT: %F.call.loc8: init %tuple.type.d07 = call %F.ref.loc8() to %.loc8
|
||||
// CHECK:STDOUT: assign %v.ref, %F.call.loc8
|
||||
// CHECK:STDOUT: %F.ref.loc9: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %F.call.loc9: init %tuple.type.d07 = call %F.ref.loc9() to %.loc5_8
|
||||
// CHECK:STDOUT: return %F.call.loc9 to %return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @H() -> %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
|
||||
// CHECK:STDOUT: %.loc15_12.1: ref %tuple.type.d07 = temporary_storage
|
||||
// CHECK:STDOUT: %G.call: init %tuple.type.d07 = call %G.ref() to %.loc15_12.1
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %.loc15_12.2: ref %tuple.type.d07 = temporary %.loc15_12.1, %G.call
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %.loc15_12.2, element0
|
||||
// CHECK:STDOUT: %.loc15_13: %i32 = bind_value %tuple.elem0
|
||||
// CHECK:STDOUT: return %.loc15_13
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- nested_tuple_in_place.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.189: type = tuple_type (%i32, %i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f9f: type = tuple_type (%tuple.type.ff9, %tuple.type.ff9) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.99b: type = tuple_type (%tuple.type.189, %tuple.type.189) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.d88: type = pattern_type %tuple.type.99b [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.3a3: type = tuple_type (type, %tuple.type.ff9, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.516: type = tuple_type (%i32, %tuple.type.189, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.6b5: type = pattern_type %tuple.type.516 [concrete]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.667: type = tuple_type (Core.IntLiteral, %tuple.type.189, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.ab5: <bound method> = bound_method %int_1.5b8, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.9a1: <bound method> = bound_method %int_1.5b8, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.b92: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude, loc28_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: %pattern_type.d88 = binding_pattern v [concrete]
|
||||
// CHECK:STDOUT: %v.var_patt: %pattern_type.d88 = var_pattern %v.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v.var: ref %tuple.type.99b = var %v.var_patt
|
||||
// CHECK:STDOUT: %F.ref.loc7_48: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %tuple.type.189 = tuple_access %v.var, element0
|
||||
// CHECK:STDOUT: %F.call.loc7_50: init %tuple.type.189 = call %F.ref.loc7_48() to %tuple.elem0
|
||||
// CHECK:STDOUT: %F.ref.loc7_53: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %tuple.type.189 = tuple_access %v.var, element1
|
||||
// CHECK:STDOUT: %F.call.loc7_55: init %tuple.type.189 = call %F.ref.loc7_53() to %tuple.elem1
|
||||
// CHECK:STDOUT: %.loc7_56.1: %tuple.type.99b = tuple_literal (%F.call.loc7_50, %F.call.loc7_55)
|
||||
// CHECK:STDOUT: %.loc7_56.2: init %tuple.type.99b = tuple_init (%F.call.loc7_50, %F.call.loc7_55) to %v.var
|
||||
// CHECK:STDOUT: %.loc7_3: init %tuple.type.99b = converted %.loc7_56.1, %.loc7_56.2
|
||||
// CHECK:STDOUT: assign %v.var, %.loc7_3
|
||||
// CHECK:STDOUT: %.loc7_43.1: type = splice_block %.loc7_43.5 [concrete = constants.%tuple.type.99b] {
|
||||
// CHECK:STDOUT: %int_32.loc7_12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc7_12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc7_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc7_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc7_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc7_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc7_25: %tuple.type.ff9 = tuple_literal (%i32.loc7_12, %i32.loc7_17, %i32.loc7_22)
|
||||
// CHECK:STDOUT: %int_32.loc7_29: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc7_29: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc7_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc7_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc7_39: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc7_39: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc7_42: %tuple.type.ff9 = tuple_literal (%i32.loc7_29, %i32.loc7_34, %i32.loc7_39)
|
||||
// CHECK:STDOUT: %.loc7_43.2: %tuple.type.f9f = tuple_literal (%.loc7_25, %.loc7_42)
|
||||
// CHECK:STDOUT: %.loc7_43.3: type = converted %.loc7_25, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: %.loc7_43.4: type = converted %.loc7_42, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: %.loc7_43.5: type = converted %.loc7_43.2, constants.%tuple.type.99b [concrete = constants.%tuple.type.99b]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref %tuple.type.99b = bind_name v, %v.var
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @H() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: %pattern_type.6b5 = binding_pattern v [concrete]
|
||||
// CHECK:STDOUT: %v.var_patt: %pattern_type.6b5 = var_pattern %v.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v.var: ref %tuple.type.516 = var %v.var_patt
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %tuple.type.189 = tuple_access %v.var, element1
|
||||
// CHECK:STDOUT: %F.call: init %tuple.type.189 = call %F.ref() to %tuple.elem1
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc13_50.1: %tuple.type.667 = tuple_literal (%int_1, %F.call, %int_2)
|
||||
// CHECK:STDOUT: %impl.elem0.loc13_50.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc13_50.1: <bound method> = bound_method %int_1, %impl.elem0.loc13_50.1 [concrete = constants.%Convert.bound.ab5]
|
||||
// CHECK:STDOUT: %specific_fn.loc13_50.1: <specific function> = specific_function %impl.elem0.loc13_50.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc13_50.2: <bound method> = bound_method %int_1, %specific_fn.loc13_50.1 [concrete = constants.%bound_method.9a1]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc13_50.1: init %i32 = call %bound_method.loc13_50.2(%int_1) [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc13_50.2: init %i32 = converted %int_1, %int.convert_checked.loc13_50.1 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %v.var, element0
|
||||
// CHECK:STDOUT: %.loc13_50.3: init %i32 = initialize_from %.loc13_50.2 to %tuple.elem0 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc13_50.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc13_50.3: <bound method> = bound_method %int_2, %impl.elem0.loc13_50.2 [concrete = constants.%Convert.bound.ef9]
|
||||
// CHECK:STDOUT: %specific_fn.loc13_50.2: <specific function> = specific_function %impl.elem0.loc13_50.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc13_50.4: <bound method> = bound_method %int_2, %specific_fn.loc13_50.2 [concrete = constants.%bound_method.b92]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc13_50.2: init %i32 = call %bound_method.loc13_50.4(%int_2) [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc13_50.4: init %i32 = converted %int_2, %int.convert_checked.loc13_50.2 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %v.var, element2
|
||||
// CHECK:STDOUT: %.loc13_50.5: init %i32 = initialize_from %.loc13_50.4 to %tuple.elem2 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc13_50.6: init %tuple.type.516 = tuple_init (%.loc13_50.3, %F.call, %.loc13_50.5) to %v.var
|
||||
// CHECK:STDOUT: %.loc13_3: init %tuple.type.516 = converted %.loc13_50.1, %.loc13_50.6
|
||||
// CHECK:STDOUT: assign %v.var, %.loc13_3
|
||||
// CHECK:STDOUT: %.loc13_36.1: type = splice_block %.loc13_36.4 [concrete = constants.%tuple.type.516] {
|
||||
// CHECK:STDOUT: %int_32.loc13_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc13_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc13_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc13_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc13_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc13_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc13_27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc13_27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc13_30: %tuple.type.ff9 = tuple_literal (%i32.loc13_17, %i32.loc13_22, %i32.loc13_27)
|
||||
// CHECK:STDOUT: %int_32.loc13_33: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc13_33: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc13_36.2: %tuple.type.3a3 = tuple_literal (%i32.loc13_11, %.loc13_30, %i32.loc13_33)
|
||||
// CHECK:STDOUT: %.loc13_36.3: type = converted %.loc13_30, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: %.loc13_36.4: type = converted %.loc13_36.2, constants.%tuple.type.516 [concrete = constants.%tuple.type.516]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref %tuple.type.516 = bind_name v, %v.var
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
+201
-356
@@ -2,6 +2,7 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=only
|
||||
// INCLUDE-FILE: toolchain/testing/min_prelude/destroy.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
@@ -16,9 +17,11 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
let (x: {}, y: {}) = ({}, {});
|
||||
var (a: {}, b: {});
|
||||
var (c: {}, d: {}) = ({}, {});
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// --- variable.carbon
|
||||
@@ -26,19 +29,25 @@ fn F() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
var tuple: ({}, {}) = ({}, {});
|
||||
var (x: {}, y: {}) = tuple;
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
fn G() {
|
||||
//@dump-sem-ir-begin
|
||||
let tuple: ({}, {}) = ({}, {});
|
||||
var (x: {}, y: {}) = tuple;
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
fn MakeTuple() -> ({}, {});
|
||||
|
||||
fn H() {
|
||||
//@dump-sem-ir-begin
|
||||
var (x: {}, y: {}) = MakeTuple();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// --- nested.carbon
|
||||
@@ -46,14 +55,18 @@ fn H() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
let (x: {}, (y: {}, z: {})) = ({}, ({}, {}));
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// --- package_scope.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
let (x: {}, y: {}) = ({}, {});
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// --- fail_in_interface.carbon
|
||||
|
||||
@@ -110,8 +123,6 @@ let (a: {}, b: {}) = ({}, {}, {});
|
||||
// CHECK:STDOUT: --- basic.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.b6b: type = tuple_type (%empty_struct_type, %empty_struct_type) [concrete]
|
||||
@@ -121,18 +132,6 @@ let (a: {}, b: {}) = ({}, {}, {});
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
@@ -140,128 +139,92 @@ let (a: {}, b: {}) = ({}, {}, {});
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.a96 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %y.patt: %pattern_type.a96 = binding_pattern y [concrete]
|
||||
// CHECK:STDOUT: %.loc5_20: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete]
|
||||
// CHECK:STDOUT: %.loc6_20: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc5_26.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_30.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_31: %tuple.type.b6b = tuple_literal (%.loc5_26.1, %.loc5_30.1)
|
||||
// CHECK:STDOUT: %.loc5_12.1: type = splice_block %.loc5_12.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc5_12.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_12.3: type = converted %.loc5_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_struct.loc5_26: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc5_26.2: %empty_struct_type = converted %.loc5_26.1, %empty_struct.loc5_26 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %.loc5_26.2
|
||||
// CHECK:STDOUT: %.loc5_19.1: type = splice_block %.loc5_19.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc5_19.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_19.3: type = converted %.loc5_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_struct.loc5_30: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc5_30.2: %empty_struct_type = converted %.loc5_30.1, %empty_struct.loc5_30 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %y: %empty_struct_type = bind_name y, %.loc5_30.2
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.a96 = binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.a96 = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %.loc6_20: %pattern_type.de4 = tuple_pattern (%a.patt, %b.patt) [concrete]
|
||||
// CHECK:STDOUT: %.var_patt.loc6: %pattern_type.de4 = var_pattern %.loc6_20 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.var.loc6: ref %tuple.type.b6b = var %.var_patt.loc6
|
||||
// CHECK:STDOUT: %tuple.elem0.loc6: ref %empty_struct_type = tuple_access %.var.loc6, element0
|
||||
// CHECK:STDOUT: %tuple.elem1.loc6: ref %empty_struct_type = tuple_access %.var.loc6, element1
|
||||
// CHECK:STDOUT: %.loc6_26.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_30.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_31: %tuple.type.b6b = tuple_literal (%.loc6_26.1, %.loc6_30.1)
|
||||
// CHECK:STDOUT: %.loc6_12.1: type = splice_block %.loc6_12.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc6_12.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_12.3: type = converted %.loc6_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %empty_struct_type = bind_name a, %tuple.elem0.loc6
|
||||
// CHECK:STDOUT: %empty_struct.loc6_26: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc6_26.2: %empty_struct_type = converted %.loc6_26.1, %empty_struct.loc6_26 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %.loc6_26.2
|
||||
// CHECK:STDOUT: %.loc6_19.1: type = splice_block %.loc6_19.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc6_19.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_19.3: type = converted %.loc6_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %empty_struct_type = bind_name b, %tuple.elem1.loc6
|
||||
// CHECK:STDOUT: %empty_struct.loc6_30: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc6_30.2: %empty_struct_type = converted %.loc6_30.1, %empty_struct.loc6_30 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %y: %empty_struct_type = bind_name y, %.loc6_30.2
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.a96 = binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %d.patt: %pattern_type.a96 = binding_pattern d [concrete]
|
||||
// CHECK:STDOUT: %.loc7_20: %pattern_type.de4 = tuple_pattern (%c.patt, %d.patt) [concrete]
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.a96 = binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.a96 = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %.loc7_20: %pattern_type.de4 = tuple_pattern (%a.patt, %b.patt) [concrete]
|
||||
// CHECK:STDOUT: %.var_patt.loc7: %pattern_type.de4 = var_pattern %.loc7_20 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.var.loc7: ref %tuple.type.b6b = var %.var_patt.loc7
|
||||
// CHECK:STDOUT: %.loc7_26.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc7_30.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc7_31.1: %tuple.type.b6b = tuple_literal (%.loc7_26.1, %.loc7_30.1)
|
||||
// CHECK:STDOUT: %tuple.elem0.loc7_31: ref %empty_struct_type = tuple_access %.var.loc7, element0
|
||||
// CHECK:STDOUT: %.loc7_26.2: init %empty_struct_type = struct_init () to %tuple.elem0.loc7_31 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc7_31.2: init %empty_struct_type = converted %.loc7_26.1, %.loc7_26.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc7_31: ref %empty_struct_type = tuple_access %.var.loc7, element1
|
||||
// CHECK:STDOUT: %.loc7_30.2: init %empty_struct_type = struct_init () to %tuple.elem1.loc7_31 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc7_31.3: init %empty_struct_type = converted %.loc7_30.1, %.loc7_30.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc7_31.4: init %tuple.type.b6b = tuple_init (%.loc7_31.2, %.loc7_31.3) to %.var.loc7 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc7_3: init %tuple.type.b6b = converted %.loc7_31.1, %.loc7_31.4 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign %.var.loc7, %.loc7_3
|
||||
// CHECK:STDOUT: %tuple.elem0.loc7_3: ref %empty_struct_type = tuple_access %.var.loc7, element0
|
||||
// CHECK:STDOUT: %tuple.elem1.loc7_3: ref %empty_struct_type = tuple_access %.var.loc7, element1
|
||||
// CHECK:STDOUT: %tuple.elem0.loc7: ref %empty_struct_type = tuple_access %.var.loc7, element0
|
||||
// CHECK:STDOUT: %tuple.elem1.loc7: ref %empty_struct_type = tuple_access %.var.loc7, element1
|
||||
// CHECK:STDOUT: %.loc7_12.1: type = splice_block %.loc7_12.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc7_12.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc7_12.3: type = converted %.loc7_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %empty_struct_type = bind_name c, %tuple.elem0.loc7_3
|
||||
// CHECK:STDOUT: %a: ref %empty_struct_type = bind_name a, %tuple.elem0.loc7
|
||||
// CHECK:STDOUT: %.loc7_19.1: type = splice_block %.loc7_19.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc7_19.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc7_19.3: type = converted %.loc7_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d: ref %empty_struct_type = bind_name d, %tuple.elem1.loc7_3
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: %b: ref %empty_struct_type = bind_name b, %tuple.elem1.loc7
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.a96 = binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %d.patt: %pattern_type.a96 = binding_pattern d [concrete]
|
||||
// CHECK:STDOUT: %.loc8_20: %pattern_type.de4 = tuple_pattern (%c.patt, %d.patt) [concrete]
|
||||
// CHECK:STDOUT: %.var_patt.loc8: %pattern_type.de4 = var_pattern %.loc8_20 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.var.loc8: ref %tuple.type.b6b = var %.var_patt.loc8
|
||||
// CHECK:STDOUT: %.loc8_26.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc8_30.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc8_31.1: %tuple.type.b6b = tuple_literal (%.loc8_26.1, %.loc8_30.1)
|
||||
// CHECK:STDOUT: %tuple.elem0.loc8_31: ref %empty_struct_type = tuple_access %.var.loc8, element0
|
||||
// CHECK:STDOUT: %.loc8_26.2: init %empty_struct_type = struct_init () to %tuple.elem0.loc8_31 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc8_31.2: init %empty_struct_type = converted %.loc8_26.1, %.loc8_26.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc8_31: ref %empty_struct_type = tuple_access %.var.loc8, element1
|
||||
// CHECK:STDOUT: %.loc8_30.2: init %empty_struct_type = struct_init () to %tuple.elem1.loc8_31 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc8_31.3: init %empty_struct_type = converted %.loc8_30.1, %.loc8_30.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc8_31.4: init %tuple.type.b6b = tuple_init (%.loc8_31.2, %.loc8_31.3) to %.var.loc8 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc8_3: init %tuple.type.b6b = converted %.loc8_31.1, %.loc8_31.4 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign %.var.loc8, %.loc8_3
|
||||
// CHECK:STDOUT: %tuple.elem0.loc8_3: ref %empty_struct_type = tuple_access %.var.loc8, element0
|
||||
// CHECK:STDOUT: %tuple.elem1.loc8_3: ref %empty_struct_type = tuple_access %.var.loc8, element1
|
||||
// CHECK:STDOUT: %.loc8_12.1: type = splice_block %.loc8_12.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc8_12.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc8_12.3: type = converted %.loc8_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %empty_struct_type = bind_name c, %tuple.elem0.loc8_3
|
||||
// CHECK:STDOUT: %.loc8_19.1: type = splice_block %.loc8_19.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc8_19.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc8_19.3: type = converted %.loc8_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d: ref %empty_struct_type = bind_name d, %tuple.elem1.loc8_3
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- variable.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.b6b: type = tuple_type (%empty_struct_type, %empty_struct_type) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.de4: type = pattern_type %tuple.type.b6b [concrete]
|
||||
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.b6b = tuple_value (%empty_struct, %empty_struct) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %MakeTuple.type: type = fn_type @MakeTuple [concrete]
|
||||
// CHECK:STDOUT: %MakeTuple: %MakeTuple.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %H.type: type = fn_type @H [concrete]
|
||||
// CHECK:STDOUT: %H: %H.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: .G = %G.decl
|
||||
// CHECK:STDOUT: .MakeTuple = %MakeTuple.decl
|
||||
// CHECK:STDOUT: .H = %H.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {}
|
||||
// CHECK:STDOUT: %MakeTuple.decl: %MakeTuple.type = fn_decl @MakeTuple [concrete = constants.%MakeTuple] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.de4 = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.de4 = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc14_21: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc14_25: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc14_26.1: %tuple.type.b6b = tuple_literal (%.loc14_21, %.loc14_25)
|
||||
// CHECK:STDOUT: %.loc14_26.2: type = converted %.loc14_21, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc14_26.3: type = converted %.loc14_25, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc14_26.4: type = converted %.loc14_26.1, constants.%tuple.type.b6b [concrete = constants.%tuple.type.b6b]
|
||||
// CHECK:STDOUT: %return.param: ref %tuple.type.b6b = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %tuple.type.b6b = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
@@ -271,59 +234,59 @@ let (a: {}, b: {}) = ({}, {}, {});
|
||||
// CHECK:STDOUT: %tuple.var_patt: %pattern_type.de4 = var_pattern %tuple.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %tuple.var: ref %tuple.type.b6b = var %tuple.var_patt
|
||||
// CHECK:STDOUT: %.loc5_27.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_31.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_32.1: %tuple.type.b6b = tuple_literal (%.loc5_27.1, %.loc5_31.1)
|
||||
// CHECK:STDOUT: %tuple.elem0.loc5: ref %empty_struct_type = tuple_access %tuple.var, element0
|
||||
// CHECK:STDOUT: %.loc5_27.2: init %empty_struct_type = struct_init () to %tuple.elem0.loc5 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc5_32.2: init %empty_struct_type = converted %.loc5_27.1, %.loc5_27.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc5: ref %empty_struct_type = tuple_access %tuple.var, element1
|
||||
// CHECK:STDOUT: %.loc5_31.2: init %empty_struct_type = struct_init () to %tuple.elem1.loc5 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc5_32.3: init %empty_struct_type = converted %.loc5_31.1, %.loc5_31.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc5_32.4: init %tuple.type.b6b = tuple_init (%.loc5_32.2, %.loc5_32.3) to %tuple.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc5_3: init %tuple.type.b6b = converted %.loc5_32.1, %.loc5_32.4 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign %tuple.var, %.loc5_3
|
||||
// CHECK:STDOUT: %.loc5_21.1: type = splice_block %.loc5_21.5 [concrete = constants.%tuple.type.b6b] {
|
||||
// CHECK:STDOUT: %.loc5_16: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_20: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_21.2: %tuple.type.b6b = tuple_literal (%.loc5_16, %.loc5_20)
|
||||
// CHECK:STDOUT: %.loc5_21.3: type = converted %.loc5_16, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc5_21.4: type = converted %.loc5_20, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc5_21.5: type = converted %.loc5_21.2, constants.%tuple.type.b6b [concrete = constants.%tuple.type.b6b]
|
||||
// CHECK:STDOUT: %.loc6_27.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_31.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_32.1: %tuple.type.b6b = tuple_literal (%.loc6_27.1, %.loc6_31.1)
|
||||
// CHECK:STDOUT: %tuple.elem0.loc6: ref %empty_struct_type = tuple_access %tuple.var, element0
|
||||
// CHECK:STDOUT: %.loc6_27.2: init %empty_struct_type = struct_init () to %tuple.elem0.loc6 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc6_32.2: init %empty_struct_type = converted %.loc6_27.1, %.loc6_27.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc6: ref %empty_struct_type = tuple_access %tuple.var, element1
|
||||
// CHECK:STDOUT: %.loc6_31.2: init %empty_struct_type = struct_init () to %tuple.elem1.loc6 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc6_32.3: init %empty_struct_type = converted %.loc6_31.1, %.loc6_31.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc6_32.4: init %tuple.type.b6b = tuple_init (%.loc6_32.2, %.loc6_32.3) to %tuple.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc6_3: init %tuple.type.b6b = converted %.loc6_32.1, %.loc6_32.4 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign %tuple.var, %.loc6_3
|
||||
// CHECK:STDOUT: %.loc6_21.1: type = splice_block %.loc6_21.5 [concrete = constants.%tuple.type.b6b] {
|
||||
// CHECK:STDOUT: %.loc6_16: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_20: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_21.2: %tuple.type.b6b = tuple_literal (%.loc6_16, %.loc6_20)
|
||||
// CHECK:STDOUT: %.loc6_21.3: type = converted %.loc6_16, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc6_21.4: type = converted %.loc6_20, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc6_21.5: type = converted %.loc6_21.2, constants.%tuple.type.b6b [concrete = constants.%tuple.type.b6b]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %tuple: ref %tuple.type.b6b = bind_name tuple, %tuple.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.a96 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %y.patt: %pattern_type.a96 = binding_pattern y [concrete]
|
||||
// CHECK:STDOUT: %.loc6_20: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete]
|
||||
// CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc6_20 [concrete]
|
||||
// CHECK:STDOUT: %.loc7_20: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete]
|
||||
// CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc7_20 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.var: ref %tuple.type.b6b = var %.var_patt
|
||||
// CHECK:STDOUT: %tuple.ref: ref %tuple.type.b6b = name_ref tuple, %tuple
|
||||
// CHECK:STDOUT: %tuple.elem0.loc6_24.1: ref %empty_struct_type = tuple_access %tuple.ref, element0
|
||||
// CHECK:STDOUT: %tuple.elem0.loc6_24.2: ref %empty_struct_type = tuple_access %.var, element0
|
||||
// CHECK:STDOUT: %.loc6_24.1: init %empty_struct_type = struct_init () to %tuple.elem0.loc6_24.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc6_24.2: init %empty_struct_type = converted %tuple.elem0.loc6_24.1, %.loc6_24.1 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc6_24.1: ref %empty_struct_type = tuple_access %tuple.ref, element1
|
||||
// CHECK:STDOUT: %tuple.elem1.loc6_24.2: ref %empty_struct_type = tuple_access %.var, element1
|
||||
// CHECK:STDOUT: %.loc6_24.3: init %empty_struct_type = struct_init () to %tuple.elem1.loc6_24.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc6_24.4: init %empty_struct_type = converted %tuple.elem1.loc6_24.1, %.loc6_24.3 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc6_24.5: init %tuple.type.b6b = tuple_init (%.loc6_24.2, %.loc6_24.4) to %.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc6_3: init %tuple.type.b6b = converted %tuple.ref, %.loc6_24.5 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign %.var, %.loc6_3
|
||||
// CHECK:STDOUT: %tuple.elem0.loc6_3: ref %empty_struct_type = tuple_access %.var, element0
|
||||
// CHECK:STDOUT: %tuple.elem1.loc6_3: ref %empty_struct_type = tuple_access %.var, element1
|
||||
// CHECK:STDOUT: %.loc6_12.1: type = splice_block %.loc6_12.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc6_12.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_12.3: type = converted %.loc6_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc7_24.1: ref %empty_struct_type = tuple_access %tuple.ref, element0
|
||||
// CHECK:STDOUT: %tuple.elem0.loc7_24.2: ref %empty_struct_type = tuple_access %.var, element0
|
||||
// CHECK:STDOUT: %.loc7_24.1: init %empty_struct_type = struct_init () to %tuple.elem0.loc7_24.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc7_24.2: init %empty_struct_type = converted %tuple.elem0.loc7_24.1, %.loc7_24.1 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc7_24.1: ref %empty_struct_type = tuple_access %tuple.ref, element1
|
||||
// CHECK:STDOUT: %tuple.elem1.loc7_24.2: ref %empty_struct_type = tuple_access %.var, element1
|
||||
// CHECK:STDOUT: %.loc7_24.3: init %empty_struct_type = struct_init () to %tuple.elem1.loc7_24.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc7_24.4: init %empty_struct_type = converted %tuple.elem1.loc7_24.1, %.loc7_24.3 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc7_24.5: init %tuple.type.b6b = tuple_init (%.loc7_24.2, %.loc7_24.4) to %.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc7_3: init %tuple.type.b6b = converted %tuple.ref, %.loc7_24.5 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign %.var, %.loc7_3
|
||||
// CHECK:STDOUT: %tuple.elem0.loc7_3: ref %empty_struct_type = tuple_access %.var, element0
|
||||
// CHECK:STDOUT: %tuple.elem1.loc7_3: ref %empty_struct_type = tuple_access %.var, element1
|
||||
// CHECK:STDOUT: %.loc7_12.1: type = splice_block %.loc7_12.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc7_12.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc7_12.3: type = converted %.loc7_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %empty_struct_type = bind_name x, %tuple.elem0.loc6_3
|
||||
// CHECK:STDOUT: %.loc6_19.1: type = splice_block %.loc6_19.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc6_19.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_19.3: type = converted %.loc6_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %x: ref %empty_struct_type = bind_name x, %tuple.elem0.loc7_3
|
||||
// CHECK:STDOUT: %.loc7_19.1: type = splice_block %.loc7_19.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc7_19.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc7_19.3: type = converted %.loc7_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %empty_struct_type = bind_name y, %tuple.elem1.loc6_3
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: %y: ref %empty_struct_type = bind_name y, %tuple.elem1.loc7_3
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() {
|
||||
@@ -331,93 +294,89 @@ let (a: {}, b: {}) = ({}, {}, {});
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %tuple.patt: %pattern_type.de4 = binding_pattern tuple [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc10_27: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc10_31: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc10_32.1: %tuple.type.b6b = tuple_literal (%.loc10_27, %.loc10_31)
|
||||
// CHECK:STDOUT: %.loc10_21.1: type = splice_block %.loc10_21.5 [concrete = constants.%tuple.type.b6b] {
|
||||
// CHECK:STDOUT: %.loc10_16: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc10_20: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc10_21.2: %tuple.type.b6b = tuple_literal (%.loc10_16, %.loc10_20)
|
||||
// CHECK:STDOUT: %.loc10_21.3: type = converted %.loc10_16, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc10_21.4: type = converted %.loc10_20, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc10_21.5: type = converted %.loc10_21.2, constants.%tuple.type.b6b [concrete = constants.%tuple.type.b6b]
|
||||
// CHECK:STDOUT: %.loc13_27: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc13_31: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc13_32.1: %tuple.type.b6b = tuple_literal (%.loc13_27, %.loc13_31)
|
||||
// CHECK:STDOUT: %.loc13_21.1: type = splice_block %.loc13_21.5 [concrete = constants.%tuple.type.b6b] {
|
||||
// CHECK:STDOUT: %.loc13_16: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc13_20: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc13_21.2: %tuple.type.b6b = tuple_literal (%.loc13_16, %.loc13_20)
|
||||
// CHECK:STDOUT: %.loc13_21.3: type = converted %.loc13_16, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc13_21.4: type = converted %.loc13_20, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc13_21.5: type = converted %.loc13_21.2, constants.%tuple.type.b6b [concrete = constants.%tuple.type.b6b]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_struct.loc10_27: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc10_32.2: %empty_struct_type = converted %.loc10_27, %empty_struct.loc10_27 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %empty_struct.loc10_31: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc10_32.3: %empty_struct_type = converted %.loc10_31, %empty_struct.loc10_31 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %tuple.loc10_32: %tuple.type.b6b = tuple_value (%.loc10_32.2, %.loc10_32.3) [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc10_32.4: %tuple.type.b6b = converted %.loc10_32.1, %tuple.loc10_32 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %tuple.loc10_7: %tuple.type.b6b = bind_name tuple, %.loc10_32.4
|
||||
// CHECK:STDOUT: %empty_struct.loc13_27: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc13_32.2: %empty_struct_type = converted %.loc13_27, %empty_struct.loc13_27 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %empty_struct.loc13_31: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc13_32.3: %empty_struct_type = converted %.loc13_31, %empty_struct.loc13_31 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %tuple.loc13_32: %tuple.type.b6b = tuple_value (%.loc13_32.2, %.loc13_32.3) [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc13_32.4: %tuple.type.b6b = converted %.loc13_32.1, %tuple.loc13_32 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %tuple.loc13_7: %tuple.type.b6b = bind_name tuple, %.loc13_32.4
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.a96 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %y.patt: %pattern_type.a96 = binding_pattern y [concrete]
|
||||
// CHECK:STDOUT: %.loc11_20: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete]
|
||||
// CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc11_20 [concrete]
|
||||
// CHECK:STDOUT: %.loc14_20: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete]
|
||||
// CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc14_20 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.var: ref %tuple.type.b6b = var %.var_patt
|
||||
// CHECK:STDOUT: %tuple.ref: %tuple.type.b6b = name_ref tuple, %tuple.loc10_7
|
||||
// CHECK:STDOUT: %tuple.elem0.loc11_24.1: %empty_struct_type = tuple_access %tuple.ref, element0
|
||||
// CHECK:STDOUT: %tuple.elem0.loc11_24.2: ref %empty_struct_type = tuple_access %.var, element0
|
||||
// CHECK:STDOUT: %.loc11_24.1: init %empty_struct_type = struct_init () to %tuple.elem0.loc11_24.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc11_24.2: init %empty_struct_type = converted %tuple.elem0.loc11_24.1, %.loc11_24.1 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc11_24.1: %empty_struct_type = tuple_access %tuple.ref, element1
|
||||
// CHECK:STDOUT: %tuple.elem1.loc11_24.2: ref %empty_struct_type = tuple_access %.var, element1
|
||||
// CHECK:STDOUT: %.loc11_24.3: init %empty_struct_type = struct_init () to %tuple.elem1.loc11_24.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc11_24.4: init %empty_struct_type = converted %tuple.elem1.loc11_24.1, %.loc11_24.3 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc11_24.5: init %tuple.type.b6b = tuple_init (%.loc11_24.2, %.loc11_24.4) to %.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_3: init %tuple.type.b6b = converted %tuple.ref, %.loc11_24.5 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign %.var, %.loc11_3
|
||||
// CHECK:STDOUT: %tuple.elem0.loc11_3: ref %empty_struct_type = tuple_access %.var, element0
|
||||
// CHECK:STDOUT: %tuple.elem1.loc11_3: ref %empty_struct_type = tuple_access %.var, element1
|
||||
// CHECK:STDOUT: %.loc11_12.1: type = splice_block %.loc11_12.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc11_12.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc11_12.3: type = converted %.loc11_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %tuple.ref: %tuple.type.b6b = name_ref tuple, %tuple.loc13_7
|
||||
// CHECK:STDOUT: %tuple.elem0.loc14_24.1: %empty_struct_type = tuple_access %tuple.ref, element0
|
||||
// CHECK:STDOUT: %tuple.elem0.loc14_24.2: ref %empty_struct_type = tuple_access %.var, element0
|
||||
// CHECK:STDOUT: %.loc14_24.1: init %empty_struct_type = struct_init () to %tuple.elem0.loc14_24.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc14_24.2: init %empty_struct_type = converted %tuple.elem0.loc14_24.1, %.loc14_24.1 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc14_24.1: %empty_struct_type = tuple_access %tuple.ref, element1
|
||||
// CHECK:STDOUT: %tuple.elem1.loc14_24.2: ref %empty_struct_type = tuple_access %.var, element1
|
||||
// CHECK:STDOUT: %.loc14_24.3: init %empty_struct_type = struct_init () to %tuple.elem1.loc14_24.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc14_24.4: init %empty_struct_type = converted %tuple.elem1.loc14_24.1, %.loc14_24.3 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc14_24.5: init %tuple.type.b6b = tuple_init (%.loc14_24.2, %.loc14_24.4) to %.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc14_3: init %tuple.type.b6b = converted %tuple.ref, %.loc14_24.5 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign %.var, %.loc14_3
|
||||
// CHECK:STDOUT: %tuple.elem0.loc14_3: ref %empty_struct_type = tuple_access %.var, element0
|
||||
// CHECK:STDOUT: %tuple.elem1.loc14_3: ref %empty_struct_type = tuple_access %.var, element1
|
||||
// CHECK:STDOUT: %.loc14_12.1: type = splice_block %.loc14_12.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc14_12.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc14_12.3: type = converted %.loc14_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %empty_struct_type = bind_name x, %tuple.elem0.loc11_3
|
||||
// CHECK:STDOUT: %.loc11_19.1: type = splice_block %.loc11_19.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc11_19.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc11_19.3: type = converted %.loc11_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %x: ref %empty_struct_type = bind_name x, %tuple.elem0.loc14_3
|
||||
// CHECK:STDOUT: %.loc14_19.1: type = splice_block %.loc14_19.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc14_19.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc14_19.3: type = converted %.loc14_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %empty_struct_type = bind_name y, %tuple.elem1.loc11_3
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: %y: ref %empty_struct_type = bind_name y, %tuple.elem1.loc14_3
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @MakeTuple() -> %return.param: %tuple.type.b6b;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @H() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.a96 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %y.patt: %pattern_type.a96 = binding_pattern y [concrete]
|
||||
// CHECK:STDOUT: %.loc17_20: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete]
|
||||
// CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc17_20 [concrete]
|
||||
// CHECK:STDOUT: %.loc22_20: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete]
|
||||
// CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc22_20 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.var: ref %tuple.type.b6b = var %.var_patt
|
||||
// CHECK:STDOUT: %MakeTuple.ref: %MakeTuple.type = name_ref MakeTuple, file.%MakeTuple.decl [concrete = constants.%MakeTuple]
|
||||
// CHECK:STDOUT: %.loc17_3: ref %tuple.type.b6b = splice_block %.var {}
|
||||
// CHECK:STDOUT: %MakeTuple.call: init %tuple.type.b6b = call %MakeTuple.ref() to %.loc17_3
|
||||
// CHECK:STDOUT: %.loc22_3: ref %tuple.type.b6b = splice_block %.var {}
|
||||
// CHECK:STDOUT: %MakeTuple.call: init %tuple.type.b6b = call %MakeTuple.ref() to %.loc22_3
|
||||
// CHECK:STDOUT: assign %.var, %MakeTuple.call
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %empty_struct_type = tuple_access %.var, element0
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %empty_struct_type = tuple_access %.var, element1
|
||||
// CHECK:STDOUT: %.loc17_12.1: type = splice_block %.loc17_12.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc17_12.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc17_12.3: type = converted %.loc17_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc22_12.1: type = splice_block %.loc22_12.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc22_12.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc22_12.3: type = converted %.loc22_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %empty_struct_type = bind_name x, %tuple.elem0
|
||||
// CHECK:STDOUT: %.loc17_19.1: type = splice_block %.loc17_19.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc17_19.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc17_19.3: type = converted %.loc17_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc22_19.1: type = splice_block %.loc22_19.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc22_19.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc22_19.3: type = converted %.loc22_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %empty_struct_type = bind_name y, %tuple.elem1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- nested.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.b6b: type = tuple_type (%empty_struct_type, %empty_struct_type) [concrete]
|
||||
@@ -428,18 +387,6 @@ let (a: {}, b: {}) = ({}, {}, {});
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
@@ -448,36 +395,36 @@ let (a: {}, b: {}) = ({}, {}, {});
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.a96 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %y.patt: %pattern_type.a96 = binding_pattern y [concrete]
|
||||
// CHECK:STDOUT: %z.patt: %pattern_type.a96 = binding_pattern z [concrete]
|
||||
// CHECK:STDOUT: %.loc5_28: %pattern_type.de4 = tuple_pattern (%y.patt, %z.patt) [concrete]
|
||||
// CHECK:STDOUT: %.loc5_29: %pattern_type.361 = tuple_pattern (%x.patt, %.loc5_28) [concrete]
|
||||
// CHECK:STDOUT: %.loc6_28: %pattern_type.de4 = tuple_pattern (%y.patt, %z.patt) [concrete]
|
||||
// CHECK:STDOUT: %.loc6_29: %pattern_type.361 = tuple_pattern (%x.patt, %.loc6_28) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc5_35.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_40.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_44.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_45: %tuple.type.b6b = tuple_literal (%.loc5_40.1, %.loc5_44.1)
|
||||
// CHECK:STDOUT: %.loc5_46: %tuple.type.6ca = tuple_literal (%.loc5_35.1, %.loc5_45)
|
||||
// CHECK:STDOUT: %.loc5_12.1: type = splice_block %.loc5_12.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc5_12.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_12.3: type = converted %.loc5_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc6_35.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_40.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_44.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_45: %tuple.type.b6b = tuple_literal (%.loc6_40.1, %.loc6_44.1)
|
||||
// CHECK:STDOUT: %.loc6_46: %tuple.type.6ca = tuple_literal (%.loc6_35.1, %.loc6_45)
|
||||
// CHECK:STDOUT: %.loc6_12.1: type = splice_block %.loc6_12.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc6_12.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_12.3: type = converted %.loc6_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_struct.loc5_35: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc5_35.2: %empty_struct_type = converted %.loc5_35.1, %empty_struct.loc5_35 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %.loc5_35.2
|
||||
// CHECK:STDOUT: %.loc5_20.1: type = splice_block %.loc5_20.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc5_20.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_20.3: type = converted %.loc5_20.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %empty_struct.loc6_35: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc6_35.2: %empty_struct_type = converted %.loc6_35.1, %empty_struct.loc6_35 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %.loc6_35.2
|
||||
// CHECK:STDOUT: %.loc6_20.1: type = splice_block %.loc6_20.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc6_20.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_20.3: type = converted %.loc6_20.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_struct.loc5_40: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc5_40.2: %empty_struct_type = converted %.loc5_40.1, %empty_struct.loc5_40 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %y: %empty_struct_type = bind_name y, %.loc5_40.2
|
||||
// CHECK:STDOUT: %.loc5_27.1: type = splice_block %.loc5_27.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc5_27.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_27.3: type = converted %.loc5_27.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %empty_struct.loc6_40: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc6_40.2: %empty_struct_type = converted %.loc6_40.1, %empty_struct.loc6_40 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %y: %empty_struct_type = bind_name y, %.loc6_40.2
|
||||
// CHECK:STDOUT: %.loc6_27.1: type = splice_block %.loc6_27.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc6_27.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc6_27.3: type = converted %.loc6_27.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_struct.loc5_44: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc5_44.2: %empty_struct_type = converted %.loc5_44.1, %empty_struct.loc5_44 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %z: %empty_struct_type = bind_name z, %.loc5_44.2
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: %empty_struct.loc6_44: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc6_44.2: %empty_struct_type = converted %.loc6_44.1, %empty_struct.loc6_44 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %z: %empty_struct_type = bind_name z, %.loc6_44.2
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- package_scope.carbon
|
||||
@@ -491,137 +438,35 @@ let (a: {}, b: {}) = ({}, {}, {});
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: .y = %y
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.a96 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %y.patt: %pattern_type.a96 = binding_pattern y [concrete]
|
||||
// CHECK:STDOUT: %.loc4_18: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete]
|
||||
// CHECK:STDOUT: %.loc5_18: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc4_10.1: type = splice_block %.loc4_10.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc4_10.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc4_10.3: type = converted %.loc4_10.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc5_10.1: type = splice_block %.loc5_10.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc5_10.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_10.3: type = converted %.loc5_10.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_struct.loc4_24: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc4_24: %empty_struct_type = converted @__global_init.%.loc4_24, %empty_struct.loc4_24 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %.loc4_24
|
||||
// CHECK:STDOUT: %.loc4_17.1: type = splice_block %.loc4_17.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc4_17.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc4_17.3: type = converted %.loc4_17.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %empty_struct.loc5_24: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc5_24: %empty_struct_type = converted @__global_init.%.loc5_24, %empty_struct.loc5_24 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %.loc5_24
|
||||
// CHECK:STDOUT: %.loc5_17.1: type = splice_block %.loc5_17.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc5_17.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_17.3: type = converted %.loc5_17.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_struct.loc4_28: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc4_28: %empty_struct_type = converted @__global_init.%.loc4_28, %empty_struct.loc4_28 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %y: %empty_struct_type = bind_name y, %.loc4_28
|
||||
// CHECK:STDOUT: %empty_struct.loc5_28: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc5_28: %empty_struct_type = converted @__global_init.%.loc5_28, %empty_struct.loc5_28 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %y: %empty_struct_type = bind_name y, %.loc5_28
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc4_24: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc4_28: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc4_29: %tuple.type = tuple_literal (%.loc4_24, %.loc4_28)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_in_interface.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .I = %I.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @I {
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: has_error
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_in_class.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: complete_type_witness = invalid
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_initializer_mismatch.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.b6b: type = tuple_type (%empty_struct_type, %empty_struct_type) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.de4: type = pattern_type %tuple.type.b6b [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.572: type = tuple_type (%empty_struct_type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .x = <unexpected>.inst21.loc8_6
|
||||
// CHECK:STDOUT: .y = <unexpected>.inst26.loc8_13
|
||||
// CHECK:STDOUT: .a = <unexpected>.inst37.loc14_6
|
||||
// CHECK:STDOUT: .b = <unexpected>.inst41.loc14_13
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.a96 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %y.patt: %pattern_type.a96 = binding_pattern y [concrete]
|
||||
// CHECK:STDOUT: %.loc8: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.a96 = binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.a96 = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %.loc14: %pattern_type.de4 = tuple_pattern (%a.patt, %b.patt) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc8_24: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc8_26: %tuple.type.572 = tuple_literal (%.loc8_24)
|
||||
// CHECK:STDOUT: %.loc14_24: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc14_28: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc14_32: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc14_33: %tuple.type.8d4 = tuple_literal (%.loc14_24, %.loc14_28, %.loc14_32)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: %.loc5_24: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_28: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc5_29: %tuple.type = tuple_literal (%.loc5_24, %.loc5_28)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
-138
@@ -1,138 +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/tuple/nested_tuple.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/nested_tuple.carbon
|
||||
|
||||
var x: ((i32, i32), i32) = ((12, 76), 6);
|
||||
|
||||
// CHECK:STDOUT: --- nested_tuple.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.45d: type = tuple_type (%tuple.type.24b, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f72: type = tuple_type (%tuple.type.d07, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7d3: type = pattern_type %tuple.type.f72 [concrete]
|
||||
// CHECK:STDOUT: %int_12.6a3: Core.IntLiteral = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %int_76.872: Core.IntLiteral = int_value 76 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.acf: type = tuple_type (%tuple.type.f94, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.a34: ref %tuple.type.d07 = tuple_access file.%x.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.e9b: ref %i32 = tuple_access %tuple.elem0.a34, element0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.221: <bound method> = bound_method %int_12.6a3, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.dae: <bound method> = bound_method %int_12.6a3, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_12.1e1: %i32 = int_value 12 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.595: ref %i32 = tuple_access %tuple.elem0.a34, element1 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.033: <bound method> = bound_method %int_76.872, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.ce4: <bound method> = bound_method %int_76.872, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_76.8dd: %i32 = int_value 76 [concrete]
|
||||
// CHECK:STDOUT: %tuple.737: %tuple.type.d07 = tuple_value (%int_12.1e1, %int_76.8dd) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.54b: ref %i32 = tuple_access file.%x.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.ce9: <bound method> = bound_method %int_6.462, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.efa: <bound method> = bound_method %int_6.462, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_6.e56: %i32 = int_value 6 [concrete]
|
||||
// CHECK:STDOUT: %tuple.51f: %tuple.type.f72 = tuple_value (%tuple.737, %int_6.e56) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.7d3 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type.7d3 = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %tuple.type.f72 = var %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc11_24.1: type = splice_block %.loc11_24.4 [concrete = constants.%tuple.type.f72] {
|
||||
// CHECK:STDOUT: %int_32.loc11_10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_10: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_18: %tuple.type.24b = tuple_literal (%i32.loc11_10, %i32.loc11_15)
|
||||
// CHECK:STDOUT: %int_32.loc11_21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_24.2: %tuple.type.45d = tuple_literal (%.loc11_18, %i32.loc11_21)
|
||||
// CHECK:STDOUT: %.loc11_24.3: type = converted %.loc11_18, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: %.loc11_24.4: type = converted %.loc11_24.2, constants.%tuple.type.f72 [concrete = constants.%tuple.type.f72]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %tuple.type.f72 = bind_name x, %x.var [concrete = %x.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12.6a3]
|
||||
// CHECK:STDOUT: %int_76: Core.IntLiteral = int_value 76 [concrete = constants.%int_76.872]
|
||||
// CHECK:STDOUT: %.loc11_36.1: %tuple.type.f94 = tuple_literal (%int_12, %int_76)
|
||||
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6.462]
|
||||
// CHECK:STDOUT: %.loc11_40.1: %tuple.type.acf = tuple_literal (%.loc11_36.1, %int_6)
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_36.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_36.1: <bound method> = bound_method %int_12, %impl.elem0.loc11_36.1 [concrete = constants.%Convert.bound.221]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_36.1: <specific function> = specific_function %impl.elem0.loc11_36.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_36.2: <bound method> = bound_method %int_12, %specific_fn.loc11_36.1 [concrete = constants.%bound_method.dae]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_36.1: init %i32 = call %bound_method.loc11_36.2(%int_12) [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %.loc11_36.2: init %i32 = converted %int_12, %int.convert_checked.loc11_36.1 [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc11_40: ref %tuple.type.d07 = tuple_access file.%x.var, element0 [concrete = constants.%tuple.elem0.a34]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc11_36: ref %i32 = tuple_access %tuple.elem0.loc11_40, element0 [concrete = constants.%tuple.elem0.e9b]
|
||||
// CHECK:STDOUT: %.loc11_36.3: init %i32 = initialize_from %.loc11_36.2 to %tuple.elem0.loc11_36 [concrete = constants.%int_12.1e1]
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_36.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_36.3: <bound method> = bound_method %int_76, %impl.elem0.loc11_36.2 [concrete = constants.%Convert.bound.033]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_36.2: <specific function> = specific_function %impl.elem0.loc11_36.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_36.4: <bound method> = bound_method %int_76, %specific_fn.loc11_36.2 [concrete = constants.%bound_method.ce4]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_36.2: init %i32 = call %bound_method.loc11_36.4(%int_76) [concrete = constants.%int_76.8dd]
|
||||
// CHECK:STDOUT: %.loc11_36.4: init %i32 = converted %int_76, %int.convert_checked.loc11_36.2 [concrete = constants.%int_76.8dd]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc11_36: ref %i32 = tuple_access %tuple.elem0.loc11_40, element1 [concrete = constants.%tuple.elem1.595]
|
||||
// CHECK:STDOUT: %.loc11_36.5: init %i32 = initialize_from %.loc11_36.4 to %tuple.elem1.loc11_36 [concrete = constants.%int_76.8dd]
|
||||
// CHECK:STDOUT: %.loc11_36.6: init %tuple.type.d07 = tuple_init (%.loc11_36.3, %.loc11_36.5) to %tuple.elem0.loc11_40 [concrete = constants.%tuple.737]
|
||||
// CHECK:STDOUT: %.loc11_40.2: init %tuple.type.d07 = converted %.loc11_36.1, %.loc11_36.6 [concrete = constants.%tuple.737]
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_40: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_40.1: <bound method> = bound_method %int_6, %impl.elem0.loc11_40 [concrete = constants.%Convert.bound.ce9]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_40: <specific function> = specific_function %impl.elem0.loc11_40, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_40.2: <bound method> = bound_method %int_6, %specific_fn.loc11_40 [concrete = constants.%bound_method.efa]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_40: init %i32 = call %bound_method.loc11_40.2(%int_6) [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %.loc11_40.3: init %i32 = converted %int_6, %int.convert_checked.loc11_40 [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc11_40: ref %i32 = tuple_access file.%x.var, element1 [concrete = constants.%tuple.elem1.54b]
|
||||
// CHECK:STDOUT: %.loc11_40.4: init %i32 = initialize_from %.loc11_40.3 to %tuple.elem1.loc11_40 [concrete = constants.%int_6.e56]
|
||||
// CHECK:STDOUT: %.loc11_40.5: init %tuple.type.f72 = tuple_init (%.loc11_40.2, %.loc11_40.4) to file.%x.var [concrete = constants.%tuple.51f]
|
||||
// CHECK:STDOUT: %.loc11_1: init %tuple.type.f72 = converted %.loc11_40.1, %.loc11_40.5 [concrete = constants.%tuple.51f]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,201 +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/tuple/nested_tuple_in_place.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/nested_tuple_in_place.carbon
|
||||
|
||||
fn F() -> (i32, i32, i32);
|
||||
|
||||
fn G() {
|
||||
var v: ((i32, i32, i32), (i32, i32, i32)) = (F(), F());
|
||||
}
|
||||
|
||||
fn H() {
|
||||
var v: (i32, (i32, i32, i32), i32) = (1, F(), 2);
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- nested_tuple_in_place.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.189: type = tuple_type (%i32, %i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.b5a: type = pattern_type %tuple.type.189 [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f9f: type = tuple_type (%tuple.type.ff9, %tuple.type.ff9) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.99b: type = tuple_type (%tuple.type.189, %tuple.type.189) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.d88: type = pattern_type %tuple.type.99b [concrete]
|
||||
// CHECK:STDOUT: %H.type: type = fn_type @H [concrete]
|
||||
// CHECK:STDOUT: %H: %H.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.3a3: type = tuple_type (type, %tuple.type.ff9, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.516: type = tuple_type (%i32, %tuple.type.189, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.6b5: type = pattern_type %tuple.type.516 [concrete]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.667: type = tuple_type (Core.IntLiteral, %tuple.type.189, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.ab5: <bound method> = bound_method %int_1.5b8, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.9a1: <bound method> = bound_method %int_1.5b8, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.b92: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: .G = %G.decl
|
||||
// CHECK:STDOUT: .H = %H.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.b5a = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.b5a = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int_32.loc11_12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_25.1: %tuple.type.ff9 = tuple_literal (%i32.loc11_12, %i32.loc11_17, %i32.loc11_22)
|
||||
// CHECK:STDOUT: %.loc11_25.2: type = converted %.loc11_25.1, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: %return.param: ref %tuple.type.189 = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %tuple.type.189 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {}
|
||||
// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() -> %return.param: %tuple.type.189;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: %pattern_type.d88 = binding_pattern v [concrete]
|
||||
// CHECK:STDOUT: %v.var_patt: %pattern_type.d88 = var_pattern %v.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v.var: ref %tuple.type.99b = var %v.var_patt
|
||||
// CHECK:STDOUT: %F.ref.loc14_48: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %tuple.type.189 = tuple_access %v.var, element0
|
||||
// CHECK:STDOUT: %F.call.loc14_50: init %tuple.type.189 = call %F.ref.loc14_48() to %tuple.elem0
|
||||
// CHECK:STDOUT: %F.ref.loc14_53: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %tuple.type.189 = tuple_access %v.var, element1
|
||||
// CHECK:STDOUT: %F.call.loc14_55: init %tuple.type.189 = call %F.ref.loc14_53() to %tuple.elem1
|
||||
// CHECK:STDOUT: %.loc14_56.1: %tuple.type.99b = tuple_literal (%F.call.loc14_50, %F.call.loc14_55)
|
||||
// CHECK:STDOUT: %.loc14_56.2: init %tuple.type.99b = tuple_init (%F.call.loc14_50, %F.call.loc14_55) to %v.var
|
||||
// CHECK:STDOUT: %.loc14_3: init %tuple.type.99b = converted %.loc14_56.1, %.loc14_56.2
|
||||
// CHECK:STDOUT: assign %v.var, %.loc14_3
|
||||
// CHECK:STDOUT: %.loc14_43.1: type = splice_block %.loc14_43.5 [concrete = constants.%tuple.type.99b] {
|
||||
// CHECK:STDOUT: %int_32.loc14_12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc14_25: %tuple.type.ff9 = tuple_literal (%i32.loc14_12, %i32.loc14_17, %i32.loc14_22)
|
||||
// CHECK:STDOUT: %int_32.loc14_29: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_29: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_39: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_39: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc14_42: %tuple.type.ff9 = tuple_literal (%i32.loc14_29, %i32.loc14_34, %i32.loc14_39)
|
||||
// CHECK:STDOUT: %.loc14_43.2: %tuple.type.f9f = tuple_literal (%.loc14_25, %.loc14_42)
|
||||
// CHECK:STDOUT: %.loc14_43.3: type = converted %.loc14_25, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: %.loc14_43.4: type = converted %.loc14_42, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: %.loc14_43.5: type = converted %.loc14_43.2, constants.%tuple.type.99b [concrete = constants.%tuple.type.99b]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref %tuple.type.99b = bind_name v, %v.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @H() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: %pattern_type.6b5 = binding_pattern v [concrete]
|
||||
// CHECK:STDOUT: %v.var_patt: %pattern_type.6b5 = var_pattern %v.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v.var: ref %tuple.type.516 = var %v.var_patt
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %tuple.elem1: ref %tuple.type.189 = tuple_access %v.var, element1
|
||||
// CHECK:STDOUT: %F.call: init %tuple.type.189 = call %F.ref() to %tuple.elem1
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc18_50.1: %tuple.type.667 = tuple_literal (%int_1, %F.call, %int_2)
|
||||
// CHECK:STDOUT: %impl.elem0.loc18_50.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc18_50.1: <bound method> = bound_method %int_1, %impl.elem0.loc18_50.1 [concrete = constants.%Convert.bound.ab5]
|
||||
// CHECK:STDOUT: %specific_fn.loc18_50.1: <specific function> = specific_function %impl.elem0.loc18_50.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc18_50.2: <bound method> = bound_method %int_1, %specific_fn.loc18_50.1 [concrete = constants.%bound_method.9a1]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc18_50.1: init %i32 = call %bound_method.loc18_50.2(%int_1) [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc18_50.2: init %i32 = converted %int_1, %int.convert_checked.loc18_50.1 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %v.var, element0
|
||||
// CHECK:STDOUT: %.loc18_50.3: init %i32 = initialize_from %.loc18_50.2 to %tuple.elem0 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc18_50.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc18_50.3: <bound method> = bound_method %int_2, %impl.elem0.loc18_50.2 [concrete = constants.%Convert.bound.ef9]
|
||||
// CHECK:STDOUT: %specific_fn.loc18_50.2: <specific function> = specific_function %impl.elem0.loc18_50.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc18_50.4: <bound method> = bound_method %int_2, %specific_fn.loc18_50.2 [concrete = constants.%bound_method.b92]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc18_50.2: init %i32 = call %bound_method.loc18_50.4(%int_2) [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc18_50.4: init %i32 = converted %int_2, %int.convert_checked.loc18_50.2 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %v.var, element2
|
||||
// CHECK:STDOUT: %.loc18_50.5: init %i32 = initialize_from %.loc18_50.4 to %tuple.elem2 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc18_50.6: init %tuple.type.516 = tuple_init (%.loc18_50.3, %F.call, %.loc18_50.5) to %v.var
|
||||
// CHECK:STDOUT: %.loc18_3: init %tuple.type.516 = converted %.loc18_50.1, %.loc18_50.6
|
||||
// CHECK:STDOUT: assign %v.var, %.loc18_3
|
||||
// CHECK:STDOUT: %.loc18_36.1: type = splice_block %.loc18_36.4 [concrete = constants.%tuple.type.516] {
|
||||
// CHECK:STDOUT: %int_32.loc18_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc18_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc18_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc18_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc18_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc18_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc18_27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc18_27: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc18_30: %tuple.type.ff9 = tuple_literal (%i32.loc18_17, %i32.loc18_22, %i32.loc18_27)
|
||||
// CHECK:STDOUT: %int_32.loc18_33: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc18_33: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc18_36.2: %tuple.type.3a3 = tuple_literal (%i32.loc18_11, %.loc18_30, %i32.loc18_33)
|
||||
// CHECK:STDOUT: %.loc18_36.3: type = converted %.loc18_30, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: %.loc18_36.4: type = converted %.loc18_36.2, constants.%tuple.type.516 [concrete = constants.%tuple.type.516]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref %tuple.type.516 = bind_name v, %v.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -0,0 +1,360 @@
|
||||
// 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
|
||||
//
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=only
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/tuple/no_prelude/basics.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/no_prelude/basics.carbon
|
||||
|
||||
// Because tuples underly a lot of types, try to keep this file to have
|
||||
// minimal dependencies on other language syntax (particularly avoiding `class`
|
||||
// and `{}`).
|
||||
|
||||
// --- empty.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
var x: () = ();
|
||||
var y: () = x;
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// --- nested_tuple.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
var x: (((), ()), ()) = (((), ()), ());
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// --- one_element.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
var x: ((),) = ((),);
|
||||
var y: ((),) = x;
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// --- two_elements.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
let v: ((), ()) = ((), ());
|
||||
let w: ((), ()) = v;
|
||||
|
||||
var x: ((), ()) = ((), ());
|
||||
var y: ((), ()) = x;
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// --- fail_assign_from_empty.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_assign_from_empty.carbon:[[@LINE+4]]:16: error: cannot initialize tuple of 1 element from tuple with 0 elements [TupleInitElementCountMismatch]
|
||||
// CHECK:STDERR: var x: ((),) = ();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
var x: ((),) = ();
|
||||
|
||||
// --- fail_assign_to_empty.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+4]]:13: error: cannot initialize tuple of 0 elements from tuple with 1 element [TupleInitElementCountMismatch]
|
||||
// CHECK:STDERR: var x: () = ((),);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
var x: () = ((),);
|
||||
|
||||
// --- fail_assign_nested.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+4]]:32: error: cannot initialize tuple of 2 elements from tuple with 3 elements [TupleInitElementCountMismatch]
|
||||
// CHECK:STDERR: var x: (((), ()), ((), ())) = (((), (), ()), ((), (), ()));
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var x: (((), ()), ((), ())) = (((), (), ()), ((), (), ()));
|
||||
|
||||
// --- fail_too_few_elements.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_too_few_elements.carbon:[[@LINE+4]]:19: error: cannot initialize tuple of 2 elements from tuple with 1 element [TupleInitElementCountMismatch]
|
||||
// CHECK:STDERR: var x: ((), ()) = ((), );
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR:
|
||||
var x: ((), ()) = ((), );
|
||||
|
||||
// CHECK:STDOUT: --- empty.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %empty_tuple.type = var %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc4_9.1: type = splice_block %.loc4_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc4_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_9.3: type = converted %.loc4_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var [concrete = %x.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %pattern_type = binding_pattern y [concrete]
|
||||
// CHECK:STDOUT: %y.var_patt: %pattern_type = var_pattern %y.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %empty_tuple.type = var %y.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc5_9.1: type = splice_block %.loc5_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc5_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc5_9.3: type = converted %.loc5_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %empty_tuple.type = bind_name y, %y.var [concrete = %y.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc4_14.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_14.2: init %empty_tuple.type = tuple_init () to file.%x.var [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc4_1: init %empty_tuple.type = converted %.loc4_14.1, %.loc4_14.2 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc4_1
|
||||
// CHECK:STDOUT: %x.ref: ref %empty_tuple.type = name_ref x, file.%x [concrete = file.%x.var]
|
||||
// CHECK:STDOUT: %.loc5_13: init %empty_tuple.type = tuple_init () to file.%y.var [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc5_1: init %empty_tuple.type = converted %x.ref, %.loc5_13 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc5_1
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- nested_tuple.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.bcd: type = tuple_type (%empty_tuple.type, %empty_tuple.type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.6e8: type = tuple_type (%tuple.type.bcd, %empty_tuple.type) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %tuple.type.6e8 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.bca: ref %tuple.type.bcd = tuple_access file.%x.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.53d: ref %empty_tuple.type = tuple_access %tuple.elem0.bca, element0 [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.8d7: ref %empty_tuple.type = tuple_access %tuple.elem0.bca, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.d8f: %tuple.type.bcd = tuple_value (%empty_tuple, %empty_tuple) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.df1: ref %empty_tuple.type = tuple_access file.%x.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.0ca: %tuple.type.6e8 = tuple_value (%tuple.d8f, %empty_tuple) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %tuple.type.6e8 = var %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc4_21.1: type = splice_block %.loc4_21.7 [concrete = constants.%tuple.type.6e8] {
|
||||
// CHECK:STDOUT: %.loc4_11: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_15: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_16: %tuple.type.bcd = tuple_literal (%.loc4_11, %.loc4_15)
|
||||
// CHECK:STDOUT: %.loc4_20: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_21.2: %tuple.type.6e8 = tuple_literal (%.loc4_16, %.loc4_20)
|
||||
// CHECK:STDOUT: %.loc4_21.3: type = converted %.loc4_11, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc4_21.4: type = converted %.loc4_15, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc4_21.5: type = converted %.loc4_16, constants.%tuple.type.bcd [concrete = constants.%tuple.type.bcd]
|
||||
// CHECK:STDOUT: %.loc4_21.6: type = converted %.loc4_20, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc4_21.7: type = converted %.loc4_21.2, constants.%tuple.type.6e8 [concrete = constants.%tuple.type.6e8]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %tuple.type.6e8 = bind_name x, %x.var [concrete = %x.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc4_28.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_32.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_33.1: %tuple.type.bcd = tuple_literal (%.loc4_28.1, %.loc4_32.1)
|
||||
// CHECK:STDOUT: %.loc4_37.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_38.1: %tuple.type.6e8 = tuple_literal (%.loc4_33.1, %.loc4_37.1)
|
||||
// CHECK:STDOUT: %tuple.elem0.loc4_38: ref %tuple.type.bcd = tuple_access file.%x.var, element0 [concrete = constants.%tuple.elem0.bca]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc4_33: ref %empty_tuple.type = tuple_access %tuple.elem0.loc4_38, element0 [concrete = constants.%tuple.elem0.53d]
|
||||
// CHECK:STDOUT: %.loc4_28.2: init %empty_tuple.type = tuple_init () to %tuple.elem0.loc4_33 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc4_33.2: init %empty_tuple.type = converted %.loc4_28.1, %.loc4_28.2 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc4_33: ref %empty_tuple.type = tuple_access %tuple.elem0.loc4_38, element1 [concrete = constants.%tuple.elem1.8d7]
|
||||
// CHECK:STDOUT: %.loc4_32.2: init %empty_tuple.type = tuple_init () to %tuple.elem1.loc4_33 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc4_33.3: init %empty_tuple.type = converted %.loc4_32.1, %.loc4_32.2 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc4_33.4: init %tuple.type.bcd = tuple_init (%.loc4_33.2, %.loc4_33.3) to %tuple.elem0.loc4_38 [concrete = constants.%tuple.d8f]
|
||||
// CHECK:STDOUT: %.loc4_38.2: init %tuple.type.bcd = converted %.loc4_33.1, %.loc4_33.4 [concrete = constants.%tuple.d8f]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc4_38: ref %empty_tuple.type = tuple_access file.%x.var, element1 [concrete = constants.%tuple.elem1.df1]
|
||||
// CHECK:STDOUT: %.loc4_37.2: init %empty_tuple.type = tuple_init () to %tuple.elem1.loc4_38 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc4_38.3: init %empty_tuple.type = converted %.loc4_37.1, %.loc4_37.2 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc4_38.4: init %tuple.type.6e8 = tuple_init (%.loc4_38.2, %.loc4_38.3) to file.%x.var [concrete = constants.%tuple.0ca]
|
||||
// CHECK:STDOUT: %.loc4_1: init %tuple.type.6e8 = converted %.loc4_38.1, %.loc4_38.4 [concrete = constants.%tuple.0ca]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc4_1
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- one_element.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_tuple.type) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %tuple.type [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.a31: ref %empty_tuple.type = tuple_access file.%x.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%empty_tuple) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.a6d: ref %empty_tuple.type = tuple_access file.%y.var, element0 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %tuple.type = var %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc4_12.1: type = splice_block %.loc4_12.4 [concrete = constants.%tuple.type] {
|
||||
// CHECK:STDOUT: %.loc4_10: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_12.2: %tuple.type = tuple_literal (%.loc4_10)
|
||||
// CHECK:STDOUT: %.loc4_12.3: type = converted %.loc4_10, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc4_12.4: type = converted %.loc4_12.2, constants.%tuple.type [concrete = constants.%tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %tuple.type = bind_name x, %x.var [concrete = %x.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %pattern_type = binding_pattern y [concrete]
|
||||
// CHECK:STDOUT: %y.var_patt: %pattern_type = var_pattern %y.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %tuple.type = var %y.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc5_12.1: type = splice_block %.loc5_12.4 [concrete = constants.%tuple.type] {
|
||||
// CHECK:STDOUT: %.loc5_10: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc5_12.2: %tuple.type = tuple_literal (%.loc5_10)
|
||||
// CHECK:STDOUT: %.loc5_12.3: type = converted %.loc5_10, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc5_12.4: type = converted %.loc5_12.2, constants.%tuple.type [concrete = constants.%tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %tuple.type = bind_name y, %y.var [concrete = %y.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc4_18.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_20.1: %tuple.type = tuple_literal (%.loc4_18.1)
|
||||
// CHECK:STDOUT: %tuple.elem0.loc4: ref %empty_tuple.type = tuple_access file.%x.var, element0 [concrete = constants.%tuple.elem0.a31]
|
||||
// CHECK:STDOUT: %.loc4_18.2: init %empty_tuple.type = tuple_init () to %tuple.elem0.loc4 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc4_20.2: init %empty_tuple.type = converted %.loc4_18.1, %.loc4_18.2 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc4_20.3: init %tuple.type = tuple_init (%.loc4_20.2) to file.%x.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc4_1: init %tuple.type = converted %.loc4_20.1, %.loc4_20.3 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc4_1
|
||||
// CHECK:STDOUT: %x.ref: ref %tuple.type = name_ref x, file.%x [concrete = file.%x.var]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc5_16.1: ref %empty_tuple.type = tuple_access %x.ref, element0 [concrete = constants.%tuple.elem0.a31]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc5_16.2: ref %empty_tuple.type = tuple_access file.%y.var, element0 [concrete = constants.%tuple.elem0.a6d]
|
||||
// CHECK:STDOUT: %.loc5_16.1: init %empty_tuple.type = tuple_init () to %tuple.elem0.loc5_16.2 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc5_16.2: init %empty_tuple.type = converted %tuple.elem0.loc5_16.1, %.loc5_16.1 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc5_16.3: init %tuple.type = tuple_init (%.loc5_16.2) to file.%y.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc5_1: init %tuple.type = converted %x.ref, %.loc5_16.3 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc5_1
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- two_elements.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_tuple.type, %empty_tuple.type) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %tuple.type [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%empty_tuple, %empty_tuple) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.6a3: ref %empty_tuple.type = tuple_access file.%x.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.b37: ref %empty_tuple.type = tuple_access file.%x.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.8f2: ref %empty_tuple.type = tuple_access file.%y.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.d90: ref %empty_tuple.type = tuple_access file.%y.var, element1 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: %pattern_type = binding_pattern v [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc4_15.1: type = splice_block %.loc4_15.5 [concrete = constants.%tuple.type] {
|
||||
// CHECK:STDOUT: %.loc4_10: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_14: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_15.2: %tuple.type = tuple_literal (%.loc4_10, %.loc4_14)
|
||||
// CHECK:STDOUT: %.loc4_15.3: type = converted %.loc4_10, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc4_15.4: type = converted %.loc4_14, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc4_15.5: type = converted %.loc4_15.2, constants.%tuple.type [concrete = constants.%tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_tuple.loc4_21: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc4_26.1: %empty_tuple.type = converted @__global_init.%.loc4_21, %empty_tuple.loc4_21 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %empty_tuple.loc4_25: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc4_26.2: %empty_tuple.type = converted @__global_init.%.loc4_25, %empty_tuple.loc4_25 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%.loc4_26.1, %.loc4_26.2) [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc4_26.3: %tuple.type = converted @__global_init.%.loc4_26, %tuple [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %v: %tuple.type = bind_name v, %.loc4_26.3
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %w.patt: %pattern_type = binding_pattern w [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.5 [concrete = constants.%tuple.type] {
|
||||
// CHECK:STDOUT: %.loc5_10: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc5_14: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc5_15.2: %tuple.type = tuple_literal (%.loc5_10, %.loc5_14)
|
||||
// CHECK:STDOUT: %.loc5_15.3: type = converted %.loc5_10, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc5_15.4: type = converted %.loc5_14, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc5_15.5: type = converted %.loc5_15.2, constants.%tuple.type [concrete = constants.%tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %w: %tuple.type = bind_name w, @__global_init.%v.ref
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %tuple.type = var %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc7_15.1: type = splice_block %.loc7_15.5 [concrete = constants.%tuple.type] {
|
||||
// CHECK:STDOUT: %.loc7_10: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc7_14: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc7_15.2: %tuple.type = tuple_literal (%.loc7_10, %.loc7_14)
|
||||
// CHECK:STDOUT: %.loc7_15.3: type = converted %.loc7_10, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc7_15.4: type = converted %.loc7_14, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc7_15.5: type = converted %.loc7_15.2, constants.%tuple.type [concrete = constants.%tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %tuple.type = bind_name x, %x.var [concrete = %x.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %pattern_type = binding_pattern y [concrete]
|
||||
// CHECK:STDOUT: %y.var_patt: %pattern_type = var_pattern %y.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %tuple.type = var %y.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc8_15.1: type = splice_block %.loc8_15.5 [concrete = constants.%tuple.type] {
|
||||
// CHECK:STDOUT: %.loc8_10: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc8_14: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc8_15.2: %tuple.type = tuple_literal (%.loc8_10, %.loc8_14)
|
||||
// CHECK:STDOUT: %.loc8_15.3: type = converted %.loc8_10, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc8_15.4: type = converted %.loc8_14, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc8_15.5: type = converted %.loc8_15.2, constants.%tuple.type [concrete = constants.%tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %tuple.type = bind_name y, %y.var [concrete = %y.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc4_21: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_25: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_26: %tuple.type = tuple_literal (%.loc4_21, %.loc4_25)
|
||||
// CHECK:STDOUT: %v.ref: %tuple.type = name_ref v, file.%v
|
||||
// CHECK:STDOUT: %.loc7_21.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc7_25.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc7_26.1: %tuple.type = tuple_literal (%.loc7_21.1, %.loc7_25.1)
|
||||
// CHECK:STDOUT: %tuple.elem0.loc7: ref %empty_tuple.type = tuple_access file.%x.var, element0 [concrete = constants.%tuple.elem0.6a3]
|
||||
// CHECK:STDOUT: %.loc7_21.2: init %empty_tuple.type = tuple_init () to %tuple.elem0.loc7 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc7_26.2: init %empty_tuple.type = converted %.loc7_21.1, %.loc7_21.2 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc7: ref %empty_tuple.type = tuple_access file.%x.var, element1 [concrete = constants.%tuple.elem1.b37]
|
||||
// CHECK:STDOUT: %.loc7_25.2: init %empty_tuple.type = tuple_init () to %tuple.elem1.loc7 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc7_26.3: init %empty_tuple.type = converted %.loc7_25.1, %.loc7_25.2 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc7_26.4: init %tuple.type = tuple_init (%.loc7_26.2, %.loc7_26.3) to file.%x.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc7_1: init %tuple.type = converted %.loc7_26.1, %.loc7_26.4 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc7_1
|
||||
// CHECK:STDOUT: %x.ref: ref %tuple.type = name_ref x, file.%x [concrete = file.%x.var]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc8_19.1: ref %empty_tuple.type = tuple_access %x.ref, element0 [concrete = constants.%tuple.elem0.6a3]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc8_19.2: ref %empty_tuple.type = tuple_access file.%y.var, element0 [concrete = constants.%tuple.elem0.8f2]
|
||||
// CHECK:STDOUT: %.loc8_19.1: init %empty_tuple.type = tuple_init () to %tuple.elem0.loc8_19.2 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc8_19.2: init %empty_tuple.type = converted %tuple.elem0.loc8_19.1, %.loc8_19.1 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc8_19.1: ref %empty_tuple.type = tuple_access %x.ref, element1 [concrete = constants.%tuple.elem1.b37]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc8_19.2: ref %empty_tuple.type = tuple_access file.%y.var, element1 [concrete = constants.%tuple.elem1.d90]
|
||||
// CHECK:STDOUT: %.loc8_19.3: init %empty_tuple.type = tuple_init () to %tuple.elem1.loc8_19.2 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc8_19.4: init %empty_tuple.type = converted %tuple.elem1.loc8_19.1, %.loc8_19.3 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc8_19.5: init %tuple.type = tuple_init (%.loc8_19.2, %.loc8_19.4) to file.%y.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc8_1: init %tuple.type = converted %x.ref, %.loc8_19.5 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc8_1
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,61 +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/tuple/no_prelude/empty.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/no_prelude/empty.carbon
|
||||
|
||||
var x: () = ();
|
||||
var y: () = x;
|
||||
|
||||
// CHECK:STDOUT: --- empty.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: .y = %y
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %empty_tuple.type = var %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc11_9.1: type = splice_block %.loc11_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc11_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc11_9.3: type = converted %.loc11_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var [concrete = %x.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %pattern_type = binding_pattern y [concrete]
|
||||
// CHECK:STDOUT: %y.var_patt: %pattern_type = var_pattern %y.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %empty_tuple.type = var %y.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc12_9.1: type = splice_block %.loc12_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc12_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc12_9.3: type = converted %.loc12_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %empty_tuple.type = bind_name y, %y.var [concrete = %y.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc11_14.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc11_14.2: init %empty_tuple.type = tuple_init () to file.%x.var [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc11_1: init %empty_tuple.type = converted %.loc11_14.1, %.loc11_14.2 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_1
|
||||
// CHECK:STDOUT: %x.ref: ref %empty_tuple.type = name_ref x, file.%x [concrete = file.%x.var]
|
||||
// CHECK:STDOUT: %.loc12_13: init %empty_tuple.type = tuple_init () to file.%y.var [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc12_1: init %empty_tuple.type = converted %x.ref, %.loc12_13 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc12_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,49 +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/tuple/no_prelude/fail_assign_empty.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon
|
||||
|
||||
// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+4]]:16: error: cannot initialize tuple of 1 element from tuple with 0 elements [TupleInitElementCountMismatch]
|
||||
// CHECK:STDERR: var x: ((),) = ();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
var x: ((),) = ();
|
||||
|
||||
// CHECK:STDOUT: --- fail_assign_empty.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_tuple.type) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %tuple.type [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %tuple.type = var %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc15_12.1: type = splice_block %.loc15_12.4 [concrete = constants.%tuple.type] {
|
||||
// CHECK:STDOUT: %.loc15_10: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc15_12.2: %tuple.type = tuple_literal (%.loc15_10)
|
||||
// CHECK:STDOUT: %.loc15_12.3: type = converted %.loc15_10, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc15_12.4: type = converted %.loc15_12.2, constants.%tuple.type [concrete = constants.%tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %tuple.type = bind_name x, %x.var [concrete = %x.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc15: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: assign file.%x.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1,48 +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/tuple/no_prelude/fail_assign_to_empty.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon
|
||||
|
||||
// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+4]]:13: error: cannot initialize tuple of 0 elements from tuple with 1 element [TupleInitElementCountMismatch]
|
||||
// CHECK:STDERR: var x: () = ((),);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
var x: () = ((),);
|
||||
|
||||
// CHECK:STDOUT: --- fail_assign_to_empty.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_tuple.type) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %empty_tuple.type = var %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc15_9.1: type = splice_block %.loc15_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc15_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc15_9.3: type = converted %.loc15_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var [concrete = %x.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc15_15: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc15_17: %tuple.type = tuple_literal (%.loc15_15)
|
||||
// CHECK:STDOUT: assign file.%x.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
-113
@@ -1,113 +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/tuple/one_element.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/one_element.carbon
|
||||
|
||||
var x: (i32,) = (4,);
|
||||
var y: (i32,) = x;
|
||||
|
||||
// CHECK:STDOUT: --- one_element.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.b74: type = pattern_type %tuple.type.a1c [concrete]
|
||||
// CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.7a5: ref %i32 = tuple_access file.%x.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_4.0c1, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_4.0c1, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%int_4.940) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: .y = %y
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.b74 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type.b74 = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %tuple.type.a1c = var %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc11_13.1: type = splice_block %.loc11_13.3 [concrete = constants.%tuple.type.a1c] {
|
||||
// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_13.2: %tuple.type.85c = tuple_literal (%i32.loc11)
|
||||
// CHECK:STDOUT: %.loc11_13.3: type = converted %.loc11_13.2, constants.%tuple.type.a1c [concrete = constants.%tuple.type.a1c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %tuple.type.a1c = bind_name x, %x.var [concrete = %x.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %pattern_type.b74 = binding_pattern y [concrete]
|
||||
// CHECK:STDOUT: %y.var_patt: %pattern_type.b74 = var_pattern %y.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %tuple.type.a1c = var %y.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc12_13.1: type = splice_block %.loc12_13.3 [concrete = constants.%tuple.type.a1c] {
|
||||
// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc12_13.2: %tuple.type.85c = tuple_literal (%i32.loc12)
|
||||
// CHECK:STDOUT: %.loc12_13.3: type = converted %.loc12_13.2, constants.%tuple.type.a1c [concrete = constants.%tuple.type.a1c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %tuple.type.a1c = bind_name y, %y.var [concrete = %y.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
|
||||
// CHECK:STDOUT: %.loc11_20.1: %tuple.type.985 = tuple_literal (%int_4)
|
||||
// CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_20.1: <bound method> = bound_method %int_4, %impl.elem0 [concrete = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_20.2: <bound method> = bound_method %int_4, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_20.2(%int_4) [concrete = constants.%int_4.940]
|
||||
// CHECK:STDOUT: %.loc11_20.2: init %i32 = converted %int_4, %int.convert_checked [concrete = constants.%int_4.940]
|
||||
// CHECK:STDOUT: %.loc11_20.3: init %tuple.type.a1c = tuple_init (%.loc11_20.2) to file.%x.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_1: init %tuple.type.a1c = converted %.loc11_20.1, %.loc11_20.3 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_1
|
||||
// CHECK:STDOUT: %x.ref: ref %tuple.type.a1c = name_ref x, file.%x [concrete = file.%x.var]
|
||||
// CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %x.ref, element0 [concrete = constants.%tuple.elem0.7a5]
|
||||
// CHECK:STDOUT: %.loc12_17.1: %i32 = bind_value %tuple.elem0
|
||||
// CHECK:STDOUT: %.loc12_17.2: init %tuple.type.a1c = tuple_init (%.loc12_17.1) to file.%y.var
|
||||
// CHECK:STDOUT: %.loc12_1: init %tuple.type.a1c = converted %x.ref, %.loc12_17.2
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc12_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
-190
@@ -1,190 +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/tuple/two_elements.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/two_elements.carbon
|
||||
|
||||
let v: (i32, i32) = (4, 102);
|
||||
let w: (i32, i32) = v;
|
||||
|
||||
var x: (i32, i32) = (4, 102);
|
||||
var y: (i32, i32) = x;
|
||||
|
||||
// CHECK:STDOUT: --- two_elements.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete]
|
||||
// CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete]
|
||||
// CHECK:STDOUT: %int_102.b54: Core.IntLiteral = int_value 102 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.ac3: <bound method> = bound_method %int_4.0c1, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.1da: <bound method> = bound_method %int_4.0c1, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound.063: <bound method> = bound_method %int_102.b54, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.c20: <bound method> = bound_method %int_102.b54, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_102.b91: %i32 = int_value 102 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_4.940, %int_102.b91) [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.466: ref %i32 = tuple_access file.%x.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.d07: ref %i32 = tuple_access file.%x.var, element1 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem0.a37: ref %i32 = tuple_access file.%y.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %tuple.elem1.45d: ref %i32 = tuple_access file.%y.var, element1 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .v = %v
|
||||
// CHECK:STDOUT: .w = %w
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: .y = %y
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: %pattern_type.511 = binding_pattern v [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc11_17.1: type = splice_block %.loc11_17.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_17.2: %tuple.type.24b = tuple_literal (%i32.loc11_9, %i32.loc11_14)
|
||||
// CHECK:STDOUT: %.loc11_17.3: type = converted %.loc11_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_28.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_28.1: <bound method> = bound_method @__global_init.%int_4.loc11, %impl.elem0.loc11_28.1 [concrete = constants.%Convert.bound.ac3]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_28.1: <specific function> = specific_function %impl.elem0.loc11_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_28.2: <bound method> = bound_method @__global_init.%int_4.loc11, %specific_fn.loc11_28.1 [concrete = constants.%bound_method.1da]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_28.1: init %i32 = call %bound_method.loc11_28.2(@__global_init.%int_4.loc11) [concrete = constants.%int_4.940]
|
||||
// CHECK:STDOUT: %.loc11_28.1: %i32 = value_of_initializer %int.convert_checked.loc11_28.1 [concrete = constants.%int_4.940]
|
||||
// CHECK:STDOUT: %.loc11_28.2: %i32 = converted @__global_init.%int_4.loc11, %.loc11_28.1 [concrete = constants.%int_4.940]
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_28.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc11_28.3: <bound method> = bound_method @__global_init.%int_102.loc11, %impl.elem0.loc11_28.2 [concrete = constants.%Convert.bound.063]
|
||||
// CHECK:STDOUT: %specific_fn.loc11_28.2: <specific function> = specific_function %impl.elem0.loc11_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc11_28.4: <bound method> = bound_method @__global_init.%int_102.loc11, %specific_fn.loc11_28.2 [concrete = constants.%bound_method.c20]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_28.2: init %i32 = call %bound_method.loc11_28.4(@__global_init.%int_102.loc11) [concrete = constants.%int_102.b91]
|
||||
// CHECK:STDOUT: %.loc11_28.3: %i32 = value_of_initializer %int.convert_checked.loc11_28.2 [concrete = constants.%int_102.b91]
|
||||
// CHECK:STDOUT: %.loc11_28.4: %i32 = converted @__global_init.%int_102.loc11, %.loc11_28.3 [concrete = constants.%int_102.b91]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc11_28.2, %.loc11_28.4) [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_28.5: %tuple.type.d07 = converted @__global_init.%.loc11, %tuple [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %v: %tuple.type.d07 = bind_name v, %.loc11_28.5
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %w.patt: %pattern_type.511 = binding_pattern w [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc12_17.1: type = splice_block %.loc12_17.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc12_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc12_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc12_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc12_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc12_17.2: %tuple.type.24b = tuple_literal (%i32.loc12_9, %i32.loc12_14)
|
||||
// CHECK:STDOUT: %.loc12_17.3: type = converted %.loc12_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %w: %tuple.type.d07 = bind_name w, @__global_init.%v.ref
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.511 = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type.511 = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %tuple.type.d07 = var %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc14_17.1: type = splice_block %.loc14_17.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc14_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc14_17.2: %tuple.type.24b = tuple_literal (%i32.loc14_9, %i32.loc14_14)
|
||||
// CHECK:STDOUT: %.loc14_17.3: type = converted %.loc14_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %tuple.type.d07 = bind_name x, %x.var [concrete = %x.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %pattern_type.511 = binding_pattern y [concrete]
|
||||
// CHECK:STDOUT: %y.var_patt: %pattern_type.511 = var_pattern %y.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %tuple.type.d07 = var %y.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc15_17.1: type = splice_block %.loc15_17.3 [concrete = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc15_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc15_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc15_17.2: %tuple.type.24b = tuple_literal (%i32.loc15_9, %i32.loc15_14)
|
||||
// CHECK:STDOUT: %.loc15_17.3: type = converted %.loc15_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %tuple.type.d07 = bind_name y, %y.var [concrete = %y.var]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_4.loc11: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
|
||||
// CHECK:STDOUT: %int_102.loc11: Core.IntLiteral = int_value 102 [concrete = constants.%int_102.b54]
|
||||
// CHECK:STDOUT: %.loc11: %tuple.type.f94 = tuple_literal (%int_4.loc11, %int_102.loc11)
|
||||
// CHECK:STDOUT: %v.ref: %tuple.type.d07 = name_ref v, file.%v
|
||||
// CHECK:STDOUT: %int_4.loc14: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
|
||||
// CHECK:STDOUT: %int_102.loc14: Core.IntLiteral = int_value 102 [concrete = constants.%int_102.b54]
|
||||
// CHECK:STDOUT: %.loc14_28.1: %tuple.type.f94 = tuple_literal (%int_4.loc14, %int_102.loc14)
|
||||
// CHECK:STDOUT: %impl.elem0.loc14_28.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc14_28.1: <bound method> = bound_method %int_4.loc14, %impl.elem0.loc14_28.1 [concrete = constants.%Convert.bound.ac3]
|
||||
// CHECK:STDOUT: %specific_fn.loc14_28.1: <specific function> = specific_function %impl.elem0.loc14_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc14_28.2: <bound method> = bound_method %int_4.loc14, %specific_fn.loc14_28.1 [concrete = constants.%bound_method.1da]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc14_28.1: init %i32 = call %bound_method.loc14_28.2(%int_4.loc14) [concrete = constants.%int_4.940]
|
||||
// CHECK:STDOUT: %.loc14_28.2: init %i32 = converted %int_4.loc14, %int.convert_checked.loc14_28.1 [concrete = constants.%int_4.940]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc14: ref %i32 = tuple_access file.%x.var, element0 [concrete = constants.%tuple.elem0.466]
|
||||
// CHECK:STDOUT: %.loc14_28.3: init %i32 = initialize_from %.loc14_28.2 to %tuple.elem0.loc14 [concrete = constants.%int_4.940]
|
||||
// CHECK:STDOUT: %impl.elem0.loc14_28.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc14_28.3: <bound method> = bound_method %int_102.loc14, %impl.elem0.loc14_28.2 [concrete = constants.%Convert.bound.063]
|
||||
// CHECK:STDOUT: %specific_fn.loc14_28.2: <specific function> = specific_function %impl.elem0.loc14_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc14_28.4: <bound method> = bound_method %int_102.loc14, %specific_fn.loc14_28.2 [concrete = constants.%bound_method.c20]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc14_28.2: init %i32 = call %bound_method.loc14_28.4(%int_102.loc14) [concrete = constants.%int_102.b91]
|
||||
// CHECK:STDOUT: %.loc14_28.4: init %i32 = converted %int_102.loc14, %int.convert_checked.loc14_28.2 [concrete = constants.%int_102.b91]
|
||||
// CHECK:STDOUT: %tuple.elem1.loc14: ref %i32 = tuple_access file.%x.var, element1 [concrete = constants.%tuple.elem1.d07]
|
||||
// CHECK:STDOUT: %.loc14_28.5: init %i32 = initialize_from %.loc14_28.4 to %tuple.elem1.loc14 [concrete = constants.%int_102.b91]
|
||||
// CHECK:STDOUT: %.loc14_28.6: init %tuple.type.d07 = tuple_init (%.loc14_28.3, %.loc14_28.5) to file.%x.var [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc14_1: init %tuple.type.d07 = converted %.loc14_28.1, %.loc14_28.6 [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc14_1
|
||||
// CHECK:STDOUT: %x.ref: ref %tuple.type.d07 = name_ref x, file.%x [concrete = file.%x.var]
|
||||
// CHECK:STDOUT: %tuple.elem0.loc15_21.1: ref %i32 = tuple_access %x.ref, element0 [concrete = constants.%tuple.elem0.466]
|
||||
// CHECK:STDOUT: %.loc15_21.1: %i32 = bind_value %tuple.elem0.loc15_21.1
|
||||
// CHECK:STDOUT: %tuple.elem0.loc15_21.2: ref %i32 = tuple_access file.%y.var, element0 [concrete = constants.%tuple.elem0.a37]
|
||||
// CHECK:STDOUT: %.loc15_21.2: init %i32 = initialize_from %.loc15_21.1 to %tuple.elem0.loc15_21.2
|
||||
// CHECK:STDOUT: %tuple.elem1.loc15_21.1: ref %i32 = tuple_access %x.ref, element1 [concrete = constants.%tuple.elem1.d07]
|
||||
// CHECK:STDOUT: %.loc15_21.3: %i32 = bind_value %tuple.elem1.loc15_21.1
|
||||
// CHECK:STDOUT: %tuple.elem1.loc15_21.2: ref %i32 = tuple_access file.%y.var, element1 [concrete = constants.%tuple.elem1.45d]
|
||||
// CHECK:STDOUT: %.loc15_21.4: init %i32 = initialize_from %.loc15_21.3 to %tuple.elem1.loc15_21.2
|
||||
// CHECK:STDOUT: %.loc15_21.5: init %tuple.type.d07 = tuple_init (%.loc15_21.2, %.loc15_21.4) to file.%y.var
|
||||
// CHECK:STDOUT: %.loc15_1: init %tuple.type.d07 = converted %x.ref, %.loc15_21.5
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc15_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
Reference in New Issue
Block a user