diff --git a/toolchain/check/testdata/alias/fail_bool_value.carbon b/toolchain/check/testdata/alias/fail_bool_value.carbon index 3828cd96aceb..678258538acc 100644 --- a/toolchain/check/testdata/alias/fail_bool_value.carbon +++ b/toolchain/check/testdata/alias/fail_bool_value.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/fail_bool_value.carbon -// CHECK:STDERR: fail_bool_value.carbon:[[@LINE+3]]:11: error: alias initializer must be a name reference [AliasRequiresNameRef] +// CHECK:STDERR: fail_bool_value.carbon:[[@LINE+4]]:11: error: alias initializer must be a name reference [AliasRequiresNameRef] // CHECK:STDERR: alias a = false; // CHECK:STDERR: ^~~~~ +// CHECK:STDERR: alias a = false; let a_test: bool = a; diff --git a/toolchain/check/testdata/alias/fail_builtins.carbon b/toolchain/check/testdata/alias/fail_builtins.carbon index 8efaccf848c4..0d60e0484c95 100644 --- a/toolchain/check/testdata/alias/fail_builtins.carbon +++ b/toolchain/check/testdata/alias/fail_builtins.carbon @@ -14,9 +14,10 @@ // CHECK:STDERR: alias a = i32; -// CHECK:STDERR: fail_builtins.carbon:[[@LINE+3]]:11: error: alias initializer must be a name reference [AliasRequiresNameRef] +// CHECK:STDERR: fail_builtins.carbon:[[@LINE+4]]:11: error: alias initializer must be a name reference [AliasRequiresNameRef] // CHECK:STDERR: alias b = bool; // CHECK:STDERR: ^~~~ +// CHECK:STDERR: alias b = bool; // CHECK:STDOUT: --- fail_builtins.carbon diff --git a/toolchain/check/testdata/alias/fail_control_flow.carbon b/toolchain/check/testdata/alias/fail_control_flow.carbon index 3438a16abe4f..f6a94949745b 100644 --- a/toolchain/check/testdata/alias/fail_control_flow.carbon +++ b/toolchain/check/testdata/alias/fail_control_flow.carbon @@ -8,21 +8,22 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/fail_control_flow.carbon -// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+15]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+16]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: alias a = true or false; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+11]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+12]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: alias a = true or false; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+7]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+8]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: alias a = true or false; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+3]]:11: error: alias initializer must be a name reference [AliasRequiresNameRef] +// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+4]]:11: error: alias initializer must be a name reference [AliasRequiresNameRef] // CHECK:STDERR: alias a = true or false; // CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: alias a = true or false; // CHECK:STDOUT: --- fail_control_flow.carbon @@ -35,7 +36,7 @@ alias a = true or false; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: %.loc26: bool = block_arg [template = constants.%true] +// CHECK:STDOUT: %.loc27: bool = block_arg [template = constants.%true] // CHECK:STDOUT: %a: = bind_alias a, [template = ] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/no_prelude/export_name.carbon b/toolchain/check/testdata/alias/no_prelude/export_name.carbon index 775b0833ff14..83f4dab69204 100644 --- a/toolchain/check/testdata/alias/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/alias/no_prelude/export_name.carbon @@ -53,9 +53,10 @@ library "[[@TEST_NAME]]"; import library "export"; -// CHECK:STDERR: fail_orig_name_not_in_export.carbon:[[@LINE+3]]:8: error: name `C` not found [NameNotFound] +// CHECK:STDERR: fail_orig_name_not_in_export.carbon:[[@LINE+4]]:8: error: name `C` not found [NameNotFound] // CHECK:STDERR: var c: C = {}; // CHECK:STDERR: ^ +// CHECK:STDERR: var c: C = {}; // --- indirect_compat.carbon @@ -204,7 +205,7 @@ var d: D* = &c; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc9: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc10: %empty_struct_type = struct_literal () // CHECK:STDOUT: assign file.%c.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon b/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon index 1f4b82dab94d..25e61149adc8 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon @@ -14,9 +14,10 @@ class D {} alias c = C; var d: D = {}; -// CHECK:STDERR: fail_aliased_name_in_diag.carbon:[[@LINE+3]]:1: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound] +// CHECK:STDERR: fail_aliased_name_in_diag.carbon:[[@LINE+4]]:1: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound] // CHECK:STDERR: let c_var: c = d; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ +// CHECK:STDERR: let c_var: c = d; // CHECK:STDOUT: --- fail_aliased_name_in_diag.carbon @@ -62,7 +63,7 @@ let c_var: c = d; // CHECK:STDOUT: %.loc15_14: init %D = converted %.loc15_13.1, %.loc15_13.2 [template = constants.%D.val] // CHECK:STDOUT: assign file.%d.var, %.loc15_14 // CHECK:STDOUT: %d.ref: ref %D = name_ref d, file.%d -// CHECK:STDOUT: %.loc20: %C = converted %d.ref, [template = ] +// CHECK:STDOUT: %.loc21: %C = converted %d.ref, [template = ] // CHECK:STDOUT: %c_var: %C = bind_name c_var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon b/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon index e3efd77671b3..d41370b1953a 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon @@ -20,9 +20,10 @@ fn F() -> {} { // CHECK:STDERR: ^~ // CHECK:STDERR: alias NS.a = {}; - // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+3]]:10: error: member name `a` not found in `NS` [MemberNameNotFoundInScope] + // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+4]]:10: error: member name `a` not found in `NS` [MemberNameNotFoundInScope] // CHECK:STDERR: return NS.a; // CHECK:STDERR: ^~~~ + // CHECK:STDERR: return NS.a; } diff --git a/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon index 55320ddb20a0..2b1b7d5eb95b 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon @@ -43,9 +43,10 @@ abstract base default final alias A = Class; // CHECK:STDERR: impl alias B = Class; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `extern` not allowed on `alias` declaration [ModifierNotAllowedOnDeclaration] +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `extern` not allowed on `alias` declaration [ModifierNotAllowedOnDeclaration] // CHECK:STDERR: extern alias C = Class; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: extern alias C = Class; // CHECK:STDOUT: --- fail_modifiers.carbon @@ -68,7 +69,7 @@ extern alias C = Class; // CHECK:STDOUT: %A: type = bind_alias A, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %Class.ref.loc44: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %B: type = bind_alias B, %Class.decl [template = constants.%Class] -// CHECK:STDOUT: %Class.ref.loc49: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %Class.ref.loc50: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %C: type = bind_alias C, %Class.decl [template = constants.%Class] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon b/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon index f4dc01c4f344..d57c2908bb23 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon @@ -21,12 +21,13 @@ alias a = C; var a: C = {}; var b: C = {}; -// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+6]]:7: error: duplicate name being declared in the same scope [NameDeclDuplicate] +// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+7]]:7: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: alias b = C; // CHECK:STDERR: ^ // CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:5: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: var b: C = {}; // CHECK:STDERR: ^ +// CHECK:STDERR: alias b = C; // CHECK:STDOUT: --- fail_name_conflict.carbon @@ -51,8 +52,8 @@ alias b = C; // CHECK:STDOUT: %a.loc21: ref %C = bind_name a, %a.var // CHECK:STDOUT: %b.var: ref %C = var b // CHECK:STDOUT: %b: ref %C = bind_name b, %b.var -// CHECK:STDOUT: %C.ref.loc30: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc30: type = bind_alias , %C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref.loc31: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %.loc31: type = bind_alias , %C.decl [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon b/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon index 4dc22d5c4e26..5e19c89fca92 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon @@ -11,9 +11,10 @@ fn F() { var a: () = (); var b: ()* = &a; - // CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:13: error: alias initializer must be a name reference [AliasRequiresNameRef] + // CHECK:STDERR: fail_not_constant.carbon:[[@LINE+4]]:13: error: alias initializer must be a name reference [AliasRequiresNameRef] // CHECK:STDERR: alias c = *b; // CHECK:STDERR: ^~ + // CHECK:STDERR: alias c = *b; } @@ -48,8 +49,8 @@ fn F() { // CHECK:STDOUT: %addr: %ptr = addr_of %a.ref // CHECK:STDOUT: assign %b.var, %addr // CHECK:STDOUT: %b.ref: ref %ptr = name_ref b, %b -// CHECK:STDOUT: %.loc17_14: %ptr = bind_value %b.ref -// CHECK:STDOUT: %.loc17_13: ref %empty_tuple.type = deref %.loc17_14 +// CHECK:STDOUT: %.loc18_14: %ptr = bind_value %b.ref +// CHECK:STDOUT: %.loc18_13: ref %empty_tuple.type = deref %.loc18_14 // CHECK:STDOUT: %c: = bind_alias c, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/no_prelude/fail_params.carbon b/toolchain/check/testdata/alias/no_prelude/fail_params.carbon index 3644ec33c5b6..479631b2624a 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_params.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_params.carbon @@ -8,13 +8,14 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/no_prelude/fail_params.carbon -// CHECK:STDERR: fail_params.carbon:[[@LINE+7]]:8: error: `alias` declaration cannot have parameters [UnexpectedDeclNameParams] +// CHECK:STDERR: fail_params.carbon:[[@LINE+8]]:8: error: `alias` declaration cannot have parameters [UnexpectedDeclNameParams] // CHECK:STDERR: alias A(T:! type) = T*; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_params.carbon:[[@LINE+3]]:21: error: alias initializer must be a name reference [AliasRequiresNameRef] +// CHECK:STDERR: fail_params.carbon:[[@LINE+4]]:21: error: alias initializer must be a name reference [AliasRequiresNameRef] // CHECK:STDERR: alias A(T:! type) = T*; // CHECK:STDERR: ^~ +// CHECK:STDERR: alias A(T:! type) = T*; // CHECK:STDOUT: --- fail_params.carbon diff --git a/toolchain/check/testdata/alias/no_prelude/import.carbon b/toolchain/check/testdata/alias/no_prelude/import.carbon index de20cee0687f..cf6f4ffe9a1f 100644 --- a/toolchain/check/testdata/alias/no_prelude/import.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import.carbon @@ -58,10 +58,11 @@ var b: () = a_alias; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_var3.carbon:[[@LINE+4]]:1: in import [InImport] +// CHECK:STDERR: fail_var3.carbon:[[@LINE+5]]:1: in import [InImport] // CHECK:STDERR: var2.carbon:8:5: error: semantics TODO: `Non-constant ImportRefLoaded (comes up with var)` [SemanticsTodo] // CHECK:STDERR: var b: () = a_alias; // CHECK:STDERR: ^ +// CHECK:STDERR: import library "var2"; var c: () = a_alias_alias; @@ -246,9 +247,9 @@ var c: () = a_alias_alias; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a_alias_alias.ref: ref %empty_tuple.type = name_ref a_alias_alias, imports.%import_ref.692 [template = ] -// CHECK:STDOUT: %.loc10_13: init %empty_tuple.type = tuple_init () to file.%c.var [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc10_26: init %empty_tuple.type = converted %a_alias_alias.ref, %.loc10_13 [template = constants.%empty_tuple] -// CHECK:STDOUT: assign file.%c.var, %.loc10_26 +// CHECK:STDOUT: %.loc11_13: init %empty_tuple.type = tuple_init () to file.%c.var [template = constants.%empty_tuple] +// CHECK:STDOUT: %.loc11_26: init %empty_tuple.type = converted %a_alias_alias.ref, %.loc11_13 [template = constants.%empty_tuple] +// CHECK:STDOUT: assign file.%c.var, %.loc11_26 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/no_prelude/import_access.carbon b/toolchain/check/testdata/alias/no_prelude/import_access.carbon index 8c45de77242e..8016a1d92acf 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_access.carbon @@ -47,9 +47,10 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:11: error: member name `A` not found in `Test` [MemberNameNotFoundInScope] +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:11: error: member name `A` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: var inst: Test.A = {}; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: var inst: Test.A = {}; // CHECK:STDOUT: --- def.carbon @@ -166,7 +167,7 @@ var inst: Test.A = {}; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc9: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc10: %empty_struct_type = struct_literal () // CHECK:STDOUT: assign file.%inst.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/fail_bound_negative.carbon b/toolchain/check/testdata/array/fail_bound_negative.carbon index b77455c9a163..bda5d622557b 100644 --- a/toolchain/check/testdata/array/fail_bound_negative.carbon +++ b/toolchain/check/testdata/array/fail_bound_negative.carbon @@ -10,9 +10,10 @@ fn Negate(n: i32) -> i32 = "int.snegate"; -// CHECK:STDERR: fail_bound_negative.carbon:[[@LINE+3]]:14: error: array bound of -1 is negative [ArrayBoundNegative] +// CHECK:STDERR: fail_bound_negative.carbon:[[@LINE+4]]:14: error: array bound of -1 is negative [ArrayBoundNegative] // CHECK:STDERR: var a: [i32; Negate(1)]; // CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: var a: [i32; Negate(1)]; // CHECK:STDOUT: --- fail_bound_negative.carbon diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index b9fa33b71e16..3e9f005761b9 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -14,12 +14,13 @@ // CHECK:STDERR: var a: [i32; 39999999999999999993]; -// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+7]]:9: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: var b: [1; 39999999999999999993]; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:9: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+4]]:9: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var b: [1; 39999999999999999993]; // CHECK:STDERR: ^ +// CHECK:STDERR: var b: [1; 39999999999999999993]; // CHECK:STDOUT: --- fail_bound_overflow.carbon diff --git a/toolchain/check/testdata/array/fail_incomplete_element.carbon b/toolchain/check/testdata/array/fail_incomplete_element.carbon index 646553e5fc29..27f8af3a94d7 100644 --- a/toolchain/check/testdata/array/fail_incomplete_element.carbon +++ b/toolchain/check/testdata/array/fail_incomplete_element.carbon @@ -10,12 +10,13 @@ class Incomplete; -// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE+6]]:8: error: variable has incomplete type `[Incomplete; 1]` [IncompleteTypeInVarDecl] +// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE+7]]:8: error: variable has incomplete type `[Incomplete; 1]` [IncompleteTypeInVarDecl] // CHECK:STDERR: var a: [Incomplete; 1]; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE-5]]:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ +// CHECK:STDERR: var a: [Incomplete; 1]; var p: Incomplete* = &a[0]; diff --git a/toolchain/check/testdata/array/fail_invalid_type.carbon b/toolchain/check/testdata/array/fail_invalid_type.carbon index b6a4d3695c2a..78c21511539d 100644 --- a/toolchain/check/testdata/array/fail_invalid_type.carbon +++ b/toolchain/check/testdata/array/fail_invalid_type.carbon @@ -8,12 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_invalid_type.carbon -// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+7]]:9: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: var a: [1; 1]; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+4]]:9: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var a: [1; 1]; // CHECK:STDERR: ^ +// CHECK:STDERR: var a: [1; 1]; // CHECK:STDOUT: --- fail_invalid_type.carbon diff --git a/toolchain/check/testdata/array/fail_out_of_bound.carbon b/toolchain/check/testdata/array/fail_out_of_bound.carbon index 133183bf89be..955407191a07 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_out_of_bound.carbon -// CHECK:STDERR: fail_out_of_bound.carbon:[[@LINE+3]]:19: error: cannot initialize array of 1 element from 3 initializers [ArrayInitFromLiteralArgCountMismatch] +// CHECK:STDERR: fail_out_of_bound.carbon:[[@LINE+4]]:19: error: cannot initialize array of 1 element from 3 initializers [ArrayInitFromLiteralArgCountMismatch] // CHECK:STDERR: var a: [i32; 1] = (1, 2, 3); // CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: --- fail_out_of_bound.carbon @@ -48,7 +49,7 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %.loc14: %tuple.type = tuple_literal (%int_1, %int_2, %int_3) +// CHECK:STDOUT: %.loc15: %tuple.type = tuple_literal (%int_1, %int_2, %int_3) // CHECK:STDOUT: assign file.%a.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon index 123be410b791..fc3d0c7fda31 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon var a: [i32; 3] = (1, 2, 3); -// CHECK:STDERR: fail_out_of_bound_non_literal.carbon:[[@LINE+3]]:16: error: array index `3` is past the end of type `[i32; 3]` [ArrayIndexOutOfBounds] +// CHECK:STDERR: fail_out_of_bound_non_literal.carbon:[[@LINE+4]]:16: error: array index `3` is past the end of type `[i32; 3]` [ArrayIndexOutOfBounds] // CHECK:STDERR: var b: i32 = a[{.index = 3}.index]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: --- fail_out_of_bound_non_literal.carbon @@ -99,22 +100,22 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %.loc11_28: init %array_type = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc11_28 // CHECK:STDOUT: %a.ref: ref %array_type = name_ref a, file.%a -// CHECK:STDOUT: %int_3.loc15: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] -// CHECK:STDOUT: %.loc15_27.1: %struct_type.index = struct_literal (%int_3.loc15) -// CHECK:STDOUT: %struct: %struct_type.index = struct_value (%int_3.loc15) [template = constants.%struct] -// CHECK:STDOUT: %.loc15_27.2: %struct_type.index = converted %.loc15_27.1, %struct [template = constants.%struct] -// CHECK:STDOUT: %.loc15_28.1: Core.IntLiteral = struct_access %.loc15_27.2, element0 [template = constants.%int_3.1ba] +// CHECK:STDOUT: %int_3.loc16: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] +// CHECK:STDOUT: %.loc16_27.1: %struct_type.index = struct_literal (%int_3.loc16) +// CHECK:STDOUT: %struct: %struct_type.index = struct_value (%int_3.loc16) [template = constants.%struct] +// CHECK:STDOUT: %.loc16_27.2: %struct_type.index = converted %.loc16_27.1, %struct [template = constants.%struct] +// CHECK:STDOUT: %.loc16_28.1: Core.IntLiteral = struct_access %.loc16_27.2, element0 [template = constants.%int_3.1ba] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc15: = bound_method %.loc15_28.1, %impl.elem0.loc15 [template = constants.%Convert.bound.b30] -// CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%.loc15_28.1) [template = constants.%int_3.822] -// CHECK:STDOUT: %.loc15_28.2: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%int_3.822] -// CHECK:STDOUT: %.loc15_28.3: %i32 = converted %.loc15_28.1, %.loc15_28.2 [template = constants.%int_3.822] -// CHECK:STDOUT: %.loc15_34.1: ref %i32 = array_index %a.ref, %.loc15_28.3 [template = ] -// CHECK:STDOUT: %.loc15_34.2: %i32 = bind_value %.loc15_34.1 -// CHECK:STDOUT: assign file.%b.var, %.loc15_34.2 +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc16: = bound_method %.loc16_28.1, %impl.elem0.loc16 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%.loc16_28.1) [template = constants.%int_3.822] +// CHECK:STDOUT: %.loc16_28.2: %i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%int_3.822] +// CHECK:STDOUT: %.loc16_28.3: %i32 = converted %.loc16_28.1, %.loc16_28.2 [template = constants.%int_3.822] +// CHECK:STDOUT: %.loc16_34.1: ref %i32 = array_index %a.ref, %.loc16_28.3 [template = ] +// CHECK:STDOUT: %.loc16_34.2: %i32 = bind_value %.loc16_34.1 +// CHECK:STDOUT: assign file.%b.var, %.loc16_34.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 8f74e5056204..2301e6be2ae5 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -34,9 +34,10 @@ var b: [i32; 3] = t1; var c: [i32; 3] = (1, 2); var t2: (i32, i32); -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:19: error: cannot initialize array of 3 elements from tuple with 2 elements [ArrayInitFromExprArgCountMismatch] +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: error: cannot initialize array of 3 elements from tuple with 2 elements [ArrayInitFromExprArgCountMismatch] // CHECK:STDERR: var d: [i32; 3] = t2; // CHECK:STDERR: ^~ +// CHECK:STDERR: var d: [i32; 3] = t2; // CHECK:STDOUT: --- fail_type_mismatch.carbon diff --git a/toolchain/check/testdata/array/fail_undefined_bound.carbon b/toolchain/check/testdata/array/fail_undefined_bound.carbon index 22e33061941b..83a0e21e61fb 100644 --- a/toolchain/check/testdata/array/fail_undefined_bound.carbon +++ b/toolchain/check/testdata/array/fail_undefined_bound.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_undefined_bound.carbon -// CHECK:STDERR: fail_undefined_bound.carbon:[[@LINE+3]]:8: error: semantics TODO: `HandleArrayExprWithoutBounds` [SemanticsTodo] +// CHECK:STDERR: fail_undefined_bound.carbon:[[@LINE+4]]:8: error: semantics TODO: `HandleArrayExprWithoutBounds` [SemanticsTodo] // CHECK:STDERR: var a: [i32; ]; // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: var a: [i32; ]; // CHECK:STDOUT: --- fail_undefined_bound.carbon diff --git a/toolchain/check/testdata/array/init_dependent_bound.carbon b/toolchain/check/testdata/array/init_dependent_bound.carbon index 4266f6ab486b..e1591a5b7483 100644 --- a/toolchain/check/testdata/array/init_dependent_bound.carbon +++ b/toolchain/check/testdata/array/init_dependent_bound.carbon @@ -25,9 +25,10 @@ fn F(N:! i32) { library "[[@TEST_NAME]]"; // TODO: This should be valid. -// CHECK:STDERR: fail_todo_init_template_dependent_bound.carbon:[[@LINE+3]]:6: error: semantics TODO: `HandleTemplate` [SemanticsTodo] +// CHECK:STDERR: fail_todo_init_template_dependent_bound.carbon:[[@LINE+4]]:6: error: semantics TODO: `HandleTemplate` [SemanticsTodo] // CHECK:STDERR: fn G(template N:! i32) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn G(template N:! i32) { var arr: [i32; N] = (1, 2, 3); } diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index a5c896d78758..7009182c6e07 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -154,12 +154,13 @@ class B { // We do not try to implicitly convert from the first operand of `as` to the // adapted type of the second operand. -// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+6]]:12: error: cannot convert from `{.x: Core.IntLiteral}` to `B` with `as` [ExplicitAsConversionFailure] +// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+7]]:12: error: cannot convert from `{.x: Core.IntLiteral}` to `B` with `as` [ExplicitAsConversionFailure] // CHECK:STDERR: var b: B = {.x = 1} as B; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+3]]:12: note: type `{.x: Core.IntLiteral}` does not implement interface `Core.As(B)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+4]]:12: note: type `{.x: Core.IntLiteral}` does not implement interface `Core.As(B)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var b: B = {.x = 1} as B; // CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: var b: B = {.x = 1} as B; // CHECK:STDOUT: --- adapt_class.carbon @@ -861,9 +862,9 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %.loc21_19: %struct_type.x.c96 = struct_literal (%int_1) +// CHECK:STDOUT: %.loc22_19: %struct_type.x.c96 = struct_literal (%int_1) // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc21_21: %B = converted %.loc21_19, [template = ] +// CHECK:STDOUT: %.loc22_21: %B = converted %.loc22_19, [template = ] // CHECK:STDOUT: assign file.%b.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index 00b9017df124..e2f666594204 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -8,12 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/as/fail_no_conversion.carbon -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:21: error: cannot convert from `Core.IntLiteral` to `(i32, i32)` with `as` [ExplicitAsConversionFailure] +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+7]]:21: error: cannot convert from `Core.IntLiteral` to `(i32, i32)` with `as` [ExplicitAsConversionFailure] // CHECK:STDERR: let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+3]]:21: note: type `Core.IntLiteral` does not implement interface `Core.As((i32, i32))` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+4]]:21: note: type `Core.IntLiteral` does not implement interface `Core.As((i32, i32))` [MissingImplInMemberAccessNote] // CHECK:STDERR: let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: --- fail_no_conversion.carbon @@ -46,14 +47,14 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %int_32.loc17_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc17_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_35.1: %tuple.type.24b = tuple_literal (%i32.loc17_27, %i32.loc17_32) -// CHECK:STDOUT: %.loc17_35.2: type = converted %.loc17_35.1, constants.%tuple.type.d07 [template = constants.%tuple.type.d07] -// CHECK:STDOUT: %.loc17_23: %tuple.type.d07 = converted %int_1, [template = ] -// CHECK:STDOUT: %tuple.elem0: %i32 = tuple_access %.loc17_23, element0 [template = ] +// CHECK:STDOUT: %int_32.loc18_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc18_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc18_35.1: %tuple.type.24b = tuple_literal (%i32.loc18_27, %i32.loc18_32) +// CHECK:STDOUT: %.loc18_35.2: type = converted %.loc18_35.1, constants.%tuple.type.d07 [template = constants.%tuple.type.d07] +// CHECK:STDOUT: %.loc18_23: %tuple.type.d07 = converted %int_1, [template = ] +// CHECK:STDOUT: %tuple.elem0: %i32 = tuple_access %.loc18_23, element0 [template = ] // CHECK:STDOUT: %n: %tuple.type.d07 = bind_name n, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index f34d13cdd91a..b0e509487ebd 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -8,12 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/as/fail_not_type.carbon -// CHECK:STDERR: fail_not_type.carbon:[[@LINE+6]]:19: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_not_type.carbon:[[@LINE+7]]:19: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: let n: i32 = 1 as 2; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_not_type.carbon:[[@LINE+3]]:19: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:19: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: let n: i32 = 1 as 2; // CHECK:STDERR: ^ +// CHECK:STDERR: let n: i32 = 1 as 2; // CHECK:STDOUT: --- fail_not_type.carbon @@ -46,7 +47,7 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] -// CHECK:STDOUT: %.loc17: type = converted %int_2, [template = ] +// CHECK:STDOUT: %.loc18: type = converted %int_2, [template = ] // CHECK:STDOUT: %n: %i32 = bind_name n, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/fail_bad_run.carbon b/toolchain/check/testdata/basics/fail_bad_run.carbon index 3b1379be7ccc..860bfde2293b 100644 --- a/toolchain/check/testdata/basics/fail_bad_run.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run.carbon @@ -8,13 +8,14 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/fail_bad_run.carbon -// CHECK:STDERR: fail_bad_run.carbon:[[@LINE+7]]:1: error: invalid signature for `Main.Run` function; expected `fn ()` or `fn () -> i32` [InvalidMainRunSignature] +// CHECK:STDERR: fail_bad_run.carbon:[[@LINE+8]]:1: error: invalid signature for `Main.Run` function; expected `fn ()` or `fn () -> i32` [InvalidMainRunSignature] // CHECK:STDERR: fn Run() -> String {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_bad_run.carbon:[[@LINE+3]]:21: error: missing `return` at end of function with declared return type [MissingReturnStatement] +// CHECK:STDERR: fail_bad_run.carbon:[[@LINE+4]]:21: error: missing `return` at end of function with declared return type [MissingReturnStatement] // CHECK:STDERR: fn Run() -> String {} // CHECK:STDERR: ^ +// CHECK:STDERR: fn Run() -> String {} // CHECK:STDOUT: --- fail_bad_run.carbon diff --git a/toolchain/check/testdata/basics/fail_bad_run_2.carbon b/toolchain/check/testdata/basics/fail_bad_run_2.carbon index 70f0ed8e4e9d..5fa43b060ef5 100644 --- a/toolchain/check/testdata/basics/fail_bad_run_2.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run_2.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/fail_bad_run_2.carbon -// CHECK:STDERR: fail_bad_run_2.carbon:[[@LINE+3]]:1: error: invalid signature for `Main.Run` function; expected `fn ()` or `fn () -> i32` [InvalidMainRunSignature] +// CHECK:STDERR: fail_bad_run_2.carbon:[[@LINE+4]]:1: error: invalid signature for `Main.Run` function; expected `fn ()` or `fn () -> i32` [InvalidMainRunSignature] // CHECK:STDERR: fn Run(n: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Run(n: i32) {} // CHECK:STDOUT: --- fail_bad_run_2.carbon @@ -41,7 +42,7 @@ fn Run(n: i32) {} // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc14: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %.loc15: type = splice_block %i32 [template = constants.%i32] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon index b902b468890f..15b53e1135ad 100644 --- a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon +++ b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon @@ -8,12 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/fail_non_type_as_type.carbon -// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+3]]:1: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+4]]:1: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ +// CHECK:STDERR: var x: type = 42; // CHECK:STDOUT: --- fail_non_type_as_type.carbon @@ -43,7 +44,7 @@ var x: type = 42; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42] -// CHECK:STDOUT: %.loc17: type = converted %int_42, [template = ] +// CHECK:STDOUT: %.loc18: type = converted %int_42, [template = ] // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index 1fd5918b0696..2b3f3cc18377 100644 --- a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon +++ b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon @@ -32,9 +32,10 @@ let c: i32 = 0x8000_0000; // CHECK:STDERR: let d: f64 = 39999999999999999993.0e3; -// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+3]]:14: error: real exponent with value 39999999999999999992 does not fit in i64 [RealExponentTooLargeForI64] +// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: error: real exponent with value 39999999999999999992 does not fit in i64 [RealExponentTooLargeForI64] // CHECK:STDERR: let e: f64 = 5.0e39999999999999999993; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: --- fail_numeric_literal_overflow.carbon diff --git a/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon b/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon index 4f9d3d2f8251..c9934da1abcc 100644 --- a/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon +++ b/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon fn Main() { - // CHECK:STDERR: fail_name_lookup.carbon:[[@LINE+3]]:3: error: name `x` not found [NameNotFound] + // CHECK:STDERR: fail_name_lookup.carbon:[[@LINE+4]]:3: error: name `x` not found [NameNotFound] // CHECK:STDERR: x; // CHECK:STDERR: ^ + // CHECK:STDERR: x; } diff --git a/toolchain/check/testdata/basics/no_prelude/fail_qualifier_unsupported.carbon b/toolchain/check/testdata/basics/no_prelude/fail_qualifier_unsupported.carbon index 78a791029911..a59d25c0f099 100644 --- a/toolchain/check/testdata/basics/no_prelude/fail_qualifier_unsupported.carbon +++ b/toolchain/check/testdata/basics/no_prelude/fail_qualifier_unsupported.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/fail_qualifier_unsupported.carbon -// CHECK:STDERR: fail_qualifier_unsupported.carbon:[[@LINE+3]]:10: error: type `bool` does not support qualified expressions [QualifiedExprUnsupported] +// CHECK:STDERR: fail_qualifier_unsupported.carbon:[[@LINE+4]]:10: error: type `bool` does not support qualified expressions [QualifiedExprUnsupported] // CHECK:STDERR: fn F() { true.b; } // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fn F() { true.b; } // CHECK:STDOUT: --- fail_qualifier_unsupported.carbon diff --git a/toolchain/check/testdata/basics/type_literals.carbon b/toolchain/check/testdata/basics/type_literals.carbon index 414fbc855f13..b24587b33e42 100644 --- a/toolchain/check/testdata/basics/type_literals.carbon +++ b/toolchain/check/testdata/basics/type_literals.carbon @@ -118,9 +118,10 @@ var test_f1000000000000: f1000000000000; library "[[@TEST_NAME]]"; // TODO: Some or all of these should eventually work. -// CHECK:STDERR: fail_fN_todo_unsupported.carbon:[[@LINE+3]]:15: error: semantics TODO: `Currently only f64 is allowed` [SemanticsTodo] +// CHECK:STDERR: fail_fN_todo_unsupported.carbon:[[@LINE+4]]:15: error: semantics TODO: `Currently only f64 is allowed` [SemanticsTodo] // CHECK:STDERR: var test_f16: f16; // CHECK:STDERR: ^~~ +// CHECK:STDERR: var test_f16: f16; var test_f32: f32; var test_f128: f128; diff --git a/toolchain/check/testdata/builtins/float/add.carbon b/toolchain/check/testdata/builtins/float/add.carbon index d3213233bb15..1be6b7ff1fd6 100644 --- a/toolchain/check/testdata/builtins/float/add.carbon +++ b/toolchain/check/testdata/builtins/float/add.carbon @@ -32,9 +32,10 @@ fn TooFew(a: f64) -> f64 = "float.add"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.add"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.add" [InvalidBuiltinSignature] +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.add" [InvalidBuiltinSignature] // CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.add"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.add"; fn JustRight(a: f64, b: f64) -> f64 = "float.add"; @@ -286,22 +287,22 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type, %.loc17_37.1 [template = bool] +// CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc17_21.1: type = splice_block %.loc17_21.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc17_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%int_64.loc17_21) [template = f64] -// CHECK:STDOUT: %.loc17_21.2: type = value_of_initializer %float.make_type.loc17_21 [template = f64] -// CHECK:STDOUT: %.loc17_21.3: type = converted %float.make_type.loc17_21, %.loc17_21.2 [template = f64] +// CHECK:STDOUT: %.loc18_21.1: type = splice_block %.loc18_21.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_21: init type = call constants.%Float(%int_64.loc18_21) [template = f64] +// CHECK:STDOUT: %.loc18_21.2: type = value_of_initializer %float.make_type.loc18_21 [template = f64] +// CHECK:STDOUT: %.loc18_21.3: type = converted %float.make_type.loc18_21, %.loc18_21.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc17_29.1: type = splice_block %.loc17_29.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc17_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%int_64.loc17_29) [template = f64] -// CHECK:STDOUT: %.loc17_29.2: type = value_of_initializer %float.make_type.loc17_29 [template = f64] -// CHECK:STDOUT: %.loc17_29.3: type = converted %float.make_type.loc17_29, %.loc17_29.2 [template = f64] +// CHECK:STDOUT: %.loc18_29.1: type = splice_block %.loc18_29.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_29: init type = call constants.%Float(%int_64.loc18_29) [template = f64] +// CHECK:STDOUT: %.loc18_29.2: type = value_of_initializer %float.make_type.loc18_29 [template = f64] +// CHECK:STDOUT: %.loc18_29.3: type = converted %float.make_type.loc18_29, %.loc18_29.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -315,24 +316,24 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc18_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_33: init type = call constants.%Float(%int_64.loc18_33) [template = f64] -// CHECK:STDOUT: %.loc18_33.1: type = value_of_initializer %float.make_type.loc18_33 [template = f64] -// CHECK:STDOUT: %.loc18_33.2: type = converted %float.make_type.loc18_33, %.loc18_33.1 [template = f64] +// CHECK:STDOUT: %int_64.loc19_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc19_33: init type = call constants.%Float(%int_64.loc19_33) [template = f64] +// CHECK:STDOUT: %.loc19_33.1: type = value_of_initializer %float.make_type.loc19_33 [template = f64] +// CHECK:STDOUT: %.loc19_33.2: type = converted %float.make_type.loc19_33, %.loc19_33.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc18_17.1: type = splice_block %.loc18_17.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc18_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%int_64.loc18_17) [template = f64] -// CHECK:STDOUT: %.loc18_17.2: type = value_of_initializer %float.make_type.loc18_17 [template = f64] -// CHECK:STDOUT: %.loc18_17.3: type = converted %float.make_type.loc18_17, %.loc18_17.2 [template = f64] +// CHECK:STDOUT: %.loc19_17.1: type = splice_block %.loc19_17.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc19_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc19_17: init type = call constants.%Float(%int_64.loc19_17) [template = f64] +// CHECK:STDOUT: %.loc19_17.2: type = value_of_initializer %float.make_type.loc19_17 [template = f64] +// CHECK:STDOUT: %.loc19_17.3: type = converted %float.make_type.loc19_17, %.loc19_17.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc18_25.1: type = splice_block %.loc18_25.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc18_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%int_64.loc18_25) [template = f64] -// CHECK:STDOUT: %.loc18_25.2: type = value_of_initializer %float.make_type.loc18_25 [template = f64] -// CHECK:STDOUT: %.loc18_25.3: type = converted %float.make_type.loc18_25, %.loc18_25.2 [template = f64] +// CHECK:STDOUT: %.loc19_25.1: type = splice_block %.loc19_25.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc19_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc19_25: init type = call constants.%Float(%int_64.loc19_25) [template = f64] +// CHECK:STDOUT: %.loc19_25.2: type = value_of_initializer %float.make_type.loc19_25 [template = f64] +// CHECK:STDOUT: %.loc19_25.3: type = converted %float.make_type.loc19_25, %.loc19_25.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 @@ -344,16 +345,16 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc20_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_40: init type = call constants.%Float(%int_64.loc20_40) [template = f64] -// CHECK:STDOUT: %.loc20_40.1: type = value_of_initializer %float.make_type.loc20_40 [template = f64] -// CHECK:STDOUT: %.loc20_40.2: type = converted %float.make_type.loc20_40, %.loc20_40.1 [template = f64] +// CHECK:STDOUT: %int_64.loc21_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc21_40: init type = call constants.%Float(%int_64.loc21_40) [template = f64] +// CHECK:STDOUT: %.loc21_40.1: type = value_of_initializer %float.make_type.loc21_40 [template = f64] +// CHECK:STDOUT: %.loc21_40.2: type = converted %float.make_type.loc21_40, %.loc21_40.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc20_32.1: type = splice_block %.loc20_32.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc20_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_32: init type = call constants.%Float(%int_64.loc20_32) [template = f64] -// CHECK:STDOUT: %.loc20_32.2: type = value_of_initializer %float.make_type.loc20_32 [template = f64] -// CHECK:STDOUT: %.loc20_32.3: type = converted %float.make_type.loc20_32, %.loc20_32.2 [template = f64] +// CHECK:STDOUT: %.loc21_32.1: type = splice_block %.loc21_32.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc21_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc21_32: init type = call constants.%Float(%int_64.loc21_32) [template = f64] +// CHECK:STDOUT: %.loc21_32.2: type = value_of_initializer %float.make_type.loc21_32 [template = f64] +// CHECK:STDOUT: %.loc21_32.3: type = converted %float.make_type.loc21_32, %.loc21_32.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 @@ -369,32 +370,32 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc24_57: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_57: init type = call constants.%Float(%int_64.loc24_57) [template = f64] -// CHECK:STDOUT: %.loc24_57.1: type = value_of_initializer %float.make_type.loc24_57 [template = f64] -// CHECK:STDOUT: %.loc24_57.2: type = converted %float.make_type.loc24_57, %.loc24_57.1 [template = f64] +// CHECK:STDOUT: %int_64.loc25_57: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_57: init type = call constants.%Float(%int_64.loc25_57) [template = f64] +// CHECK:STDOUT: %.loc25_57.1: type = value_of_initializer %float.make_type.loc25_57 [template = f64] +// CHECK:STDOUT: %.loc25_57.2: type = converted %float.make_type.loc25_57, %.loc25_57.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc24_33.1: type = splice_block %.loc24_33.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_33: init type = call constants.%Float(%int_64.loc24_33) [template = f64] -// CHECK:STDOUT: %.loc24_33.2: type = value_of_initializer %float.make_type.loc24_33 [template = f64] -// CHECK:STDOUT: %.loc24_33.3: type = converted %float.make_type.loc24_33, %.loc24_33.2 [template = f64] +// CHECK:STDOUT: %.loc25_33.1: type = splice_block %.loc25_33.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc25_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_33: init type = call constants.%Float(%int_64.loc25_33) [template = f64] +// CHECK:STDOUT: %.loc25_33.2: type = value_of_initializer %float.make_type.loc25_33 [template = f64] +// CHECK:STDOUT: %.loc25_33.3: type = converted %float.make_type.loc25_33, %.loc25_33.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc24_41.1: type = splice_block %.loc24_41.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_41: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_41: init type = call constants.%Float(%int_64.loc24_41) [template = f64] -// CHECK:STDOUT: %.loc24_41.2: type = value_of_initializer %float.make_type.loc24_41 [template = f64] -// CHECK:STDOUT: %.loc24_41.3: type = converted %float.make_type.loc24_41, %.loc24_41.2 [template = f64] +// CHECK:STDOUT: %.loc25_41.1: type = splice_block %.loc25_41.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc25_41: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_41: init type = call constants.%Float(%int_64.loc25_41) [template = f64] +// CHECK:STDOUT: %.loc25_41.2: type = value_of_initializer %float.make_type.loc25_41 [template = f64] +// CHECK:STDOUT: %.loc25_41.3: type = converted %float.make_type.loc25_41, %.loc25_41.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 -// CHECK:STDOUT: %.loc24_49.1: type = splice_block %.loc24_49.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_49: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_49: init type = call constants.%Float(%int_64.loc24_49) [template = f64] -// CHECK:STDOUT: %.loc24_49.2: type = value_of_initializer %float.make_type.loc24_49 [template = f64] -// CHECK:STDOUT: %.loc24_49.3: type = converted %float.make_type.loc24_49, %.loc24_49.2 [template = f64] +// CHECK:STDOUT: %.loc25_49.1: type = splice_block %.loc25_49.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc25_49: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_49: init type = call constants.%Float(%int_64.loc25_49) [template = f64] +// CHECK:STDOUT: %.loc25_49.2: type = value_of_initializer %float.make_type.loc25_49 [template = f64] +// CHECK:STDOUT: %.loc25_49.3: type = converted %float.make_type.loc25_49, %.loc25_49.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 @@ -409,22 +410,22 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc28_55.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc28_55.2: type = converted %bool.make_type, %.loc28_55.1 [template = bool] +// CHECK:STDOUT: %.loc29_55.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc29_55.2: type = converted %bool.make_type, %.loc29_55.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc28_39.1: type = splice_block %.loc28_39.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_39: init type = call constants.%Float(%int_64.loc28_39) [template = f64] -// CHECK:STDOUT: %.loc28_39.2: type = value_of_initializer %float.make_type.loc28_39 [template = f64] -// CHECK:STDOUT: %.loc28_39.3: type = converted %float.make_type.loc28_39, %.loc28_39.2 [template = f64] +// CHECK:STDOUT: %.loc29_39.1: type = splice_block %.loc29_39.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc29_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc29_39: init type = call constants.%Float(%int_64.loc29_39) [template = f64] +// CHECK:STDOUT: %.loc29_39.2: type = value_of_initializer %float.make_type.loc29_39 [template = f64] +// CHECK:STDOUT: %.loc29_39.3: type = converted %float.make_type.loc29_39, %.loc29_39.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc28_47.1: type = splice_block %.loc28_47.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_47: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_47: init type = call constants.%Float(%int_64.loc28_47) [template = f64] -// CHECK:STDOUT: %.loc28_47.2: type = value_of_initializer %float.make_type.loc28_47 [template = f64] -// CHECK:STDOUT: %.loc28_47.3: type = converted %float.make_type.loc28_47, %.loc28_47.2 [template = f64] +// CHECK:STDOUT: %.loc29_47.1: type = splice_block %.loc29_47.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc29_47: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc29_47: init type = call constants.%Float(%int_64.loc29_47) [template = f64] +// CHECK:STDOUT: %.loc29_47.2: type = value_of_initializer %float.make_type.loc29_47 [template = f64] +// CHECK:STDOUT: %.loc29_47.3: type = converted %float.make_type.loc29_47, %.loc29_47.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -445,9 +446,9 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a // CHECK:STDOUT: %TooFew.call: init f64 = call %TooFew.ref(%a.ref) -// CHECK:STDOUT: %.loc21_19.1: f64 = value_of_initializer %TooFew.call -// CHECK:STDOUT: %.loc21_19.2: f64 = converted %TooFew.call, %.loc21_19.1 -// CHECK:STDOUT: return %.loc21_19.2 +// CHECK:STDOUT: %.loc22_19.1: f64 = value_of_initializer %TooFew.call +// CHECK:STDOUT: %.loc22_19.2: f64 = converted %TooFew.call, %.loc22_19.1 +// CHECK:STDOUT: return %.loc22_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCallIsValidTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { @@ -457,9 +458,9 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %b.ref: f64 = name_ref b, %b // CHECK:STDOUT: %c.ref: f64 = name_ref c, %c // CHECK:STDOUT: %TooMany.call: init f64 = call %TooMany.ref(%a.ref, %b.ref, %c.ref) -// CHECK:STDOUT: %.loc25_26.1: f64 = value_of_initializer %TooMany.call -// CHECK:STDOUT: %.loc25_26.2: f64 = converted %TooMany.call, %.loc25_26.1 -// CHECK:STDOUT: return %.loc25_26.2 +// CHECK:STDOUT: %.loc26_26.1: f64 = value_of_initializer %TooMany.call +// CHECK:STDOUT: %.loc26_26.2: f64 = converted %TooMany.call, %.loc26_26.1 +// CHECK:STDOUT: return %.loc26_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCallIsValidBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { @@ -468,8 +469,8 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a // CHECK:STDOUT: %b.ref: f64 = name_ref b, %b // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc29_29.1: bool = value_of_initializer %BadReturnType.call -// CHECK:STDOUT: %.loc29_29.2: bool = converted %BadReturnType.call, %.loc29_29.1 -// CHECK:STDOUT: return %.loc29_29.2 +// CHECK:STDOUT: %.loc30_29.1: bool = value_of_initializer %BadReturnType.call +// CHECK:STDOUT: %.loc30_29.2: bool = converted %BadReturnType.call, %.loc30_29.1 +// CHECK:STDOUT: return %.loc30_29.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/div.carbon b/toolchain/check/testdata/builtins/float/div.carbon index a4656f8ad9e3..1b0efeb68d2e 100644 --- a/toolchain/check/testdata/builtins/float/div.carbon +++ b/toolchain/check/testdata/builtins/float/div.carbon @@ -34,9 +34,10 @@ fn TooFew(a: f64) -> f64 = "float.div"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.div"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.div" [InvalidBuiltinSignature] +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.div" [InvalidBuiltinSignature] // CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.div"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.div"; fn JustRight(a: f64, b: f64) -> f64 = "float.div"; @@ -308,22 +309,22 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type, %.loc17_37.1 [template = bool] +// CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc17_21.1: type = splice_block %.loc17_21.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc17_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%int_64.loc17_21) [template = f64] -// CHECK:STDOUT: %.loc17_21.2: type = value_of_initializer %float.make_type.loc17_21 [template = f64] -// CHECK:STDOUT: %.loc17_21.3: type = converted %float.make_type.loc17_21, %.loc17_21.2 [template = f64] +// CHECK:STDOUT: %.loc18_21.1: type = splice_block %.loc18_21.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_21: init type = call constants.%Float(%int_64.loc18_21) [template = f64] +// CHECK:STDOUT: %.loc18_21.2: type = value_of_initializer %float.make_type.loc18_21 [template = f64] +// CHECK:STDOUT: %.loc18_21.3: type = converted %float.make_type.loc18_21, %.loc18_21.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc17_29.1: type = splice_block %.loc17_29.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc17_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%int_64.loc17_29) [template = f64] -// CHECK:STDOUT: %.loc17_29.2: type = value_of_initializer %float.make_type.loc17_29 [template = f64] -// CHECK:STDOUT: %.loc17_29.3: type = converted %float.make_type.loc17_29, %.loc17_29.2 [template = f64] +// CHECK:STDOUT: %.loc18_29.1: type = splice_block %.loc18_29.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_29: init type = call constants.%Float(%int_64.loc18_29) [template = f64] +// CHECK:STDOUT: %.loc18_29.2: type = value_of_initializer %float.make_type.loc18_29 [template = f64] +// CHECK:STDOUT: %.loc18_29.3: type = converted %float.make_type.loc18_29, %.loc18_29.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -337,24 +338,24 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc18_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_33: init type = call constants.%Float(%int_64.loc18_33) [template = f64] -// CHECK:STDOUT: %.loc18_33.1: type = value_of_initializer %float.make_type.loc18_33 [template = f64] -// CHECK:STDOUT: %.loc18_33.2: type = converted %float.make_type.loc18_33, %.loc18_33.1 [template = f64] +// CHECK:STDOUT: %int_64.loc19_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc19_33: init type = call constants.%Float(%int_64.loc19_33) [template = f64] +// CHECK:STDOUT: %.loc19_33.1: type = value_of_initializer %float.make_type.loc19_33 [template = f64] +// CHECK:STDOUT: %.loc19_33.2: type = converted %float.make_type.loc19_33, %.loc19_33.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc18_17.1: type = splice_block %.loc18_17.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc18_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%int_64.loc18_17) [template = f64] -// CHECK:STDOUT: %.loc18_17.2: type = value_of_initializer %float.make_type.loc18_17 [template = f64] -// CHECK:STDOUT: %.loc18_17.3: type = converted %float.make_type.loc18_17, %.loc18_17.2 [template = f64] +// CHECK:STDOUT: %.loc19_17.1: type = splice_block %.loc19_17.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc19_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc19_17: init type = call constants.%Float(%int_64.loc19_17) [template = f64] +// CHECK:STDOUT: %.loc19_17.2: type = value_of_initializer %float.make_type.loc19_17 [template = f64] +// CHECK:STDOUT: %.loc19_17.3: type = converted %float.make_type.loc19_17, %.loc19_17.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc18_25.1: type = splice_block %.loc18_25.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc18_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%int_64.loc18_25) [template = f64] -// CHECK:STDOUT: %.loc18_25.2: type = value_of_initializer %float.make_type.loc18_25 [template = f64] -// CHECK:STDOUT: %.loc18_25.3: type = converted %float.make_type.loc18_25, %.loc18_25.2 [template = f64] +// CHECK:STDOUT: %.loc19_25.1: type = splice_block %.loc19_25.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc19_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc19_25: init type = call constants.%Float(%int_64.loc19_25) [template = f64] +// CHECK:STDOUT: %.loc19_25.2: type = value_of_initializer %float.make_type.loc19_25 [template = f64] +// CHECK:STDOUT: %.loc19_25.3: type = converted %float.make_type.loc19_25, %.loc19_25.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 @@ -366,16 +367,16 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc20_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_40: init type = call constants.%Float(%int_64.loc20_40) [template = f64] -// CHECK:STDOUT: %.loc20_40.1: type = value_of_initializer %float.make_type.loc20_40 [template = f64] -// CHECK:STDOUT: %.loc20_40.2: type = converted %float.make_type.loc20_40, %.loc20_40.1 [template = f64] +// CHECK:STDOUT: %int_64.loc21_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc21_40: init type = call constants.%Float(%int_64.loc21_40) [template = f64] +// CHECK:STDOUT: %.loc21_40.1: type = value_of_initializer %float.make_type.loc21_40 [template = f64] +// CHECK:STDOUT: %.loc21_40.2: type = converted %float.make_type.loc21_40, %.loc21_40.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc20_32.1: type = splice_block %.loc20_32.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc20_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_32: init type = call constants.%Float(%int_64.loc20_32) [template = f64] -// CHECK:STDOUT: %.loc20_32.2: type = value_of_initializer %float.make_type.loc20_32 [template = f64] -// CHECK:STDOUT: %.loc20_32.3: type = converted %float.make_type.loc20_32, %.loc20_32.2 [template = f64] +// CHECK:STDOUT: %.loc21_32.1: type = splice_block %.loc21_32.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc21_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc21_32: init type = call constants.%Float(%int_64.loc21_32) [template = f64] +// CHECK:STDOUT: %.loc21_32.2: type = value_of_initializer %float.make_type.loc21_32 [template = f64] +// CHECK:STDOUT: %.loc21_32.3: type = converted %float.make_type.loc21_32, %.loc21_32.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 @@ -391,32 +392,32 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc24_57: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_57: init type = call constants.%Float(%int_64.loc24_57) [template = f64] -// CHECK:STDOUT: %.loc24_57.1: type = value_of_initializer %float.make_type.loc24_57 [template = f64] -// CHECK:STDOUT: %.loc24_57.2: type = converted %float.make_type.loc24_57, %.loc24_57.1 [template = f64] +// CHECK:STDOUT: %int_64.loc25_57: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_57: init type = call constants.%Float(%int_64.loc25_57) [template = f64] +// CHECK:STDOUT: %.loc25_57.1: type = value_of_initializer %float.make_type.loc25_57 [template = f64] +// CHECK:STDOUT: %.loc25_57.2: type = converted %float.make_type.loc25_57, %.loc25_57.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc24_33.1: type = splice_block %.loc24_33.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_33: init type = call constants.%Float(%int_64.loc24_33) [template = f64] -// CHECK:STDOUT: %.loc24_33.2: type = value_of_initializer %float.make_type.loc24_33 [template = f64] -// CHECK:STDOUT: %.loc24_33.3: type = converted %float.make_type.loc24_33, %.loc24_33.2 [template = f64] +// CHECK:STDOUT: %.loc25_33.1: type = splice_block %.loc25_33.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc25_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_33: init type = call constants.%Float(%int_64.loc25_33) [template = f64] +// CHECK:STDOUT: %.loc25_33.2: type = value_of_initializer %float.make_type.loc25_33 [template = f64] +// CHECK:STDOUT: %.loc25_33.3: type = converted %float.make_type.loc25_33, %.loc25_33.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc24_41.1: type = splice_block %.loc24_41.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_41: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_41: init type = call constants.%Float(%int_64.loc24_41) [template = f64] -// CHECK:STDOUT: %.loc24_41.2: type = value_of_initializer %float.make_type.loc24_41 [template = f64] -// CHECK:STDOUT: %.loc24_41.3: type = converted %float.make_type.loc24_41, %.loc24_41.2 [template = f64] +// CHECK:STDOUT: %.loc25_41.1: type = splice_block %.loc25_41.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc25_41: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_41: init type = call constants.%Float(%int_64.loc25_41) [template = f64] +// CHECK:STDOUT: %.loc25_41.2: type = value_of_initializer %float.make_type.loc25_41 [template = f64] +// CHECK:STDOUT: %.loc25_41.3: type = converted %float.make_type.loc25_41, %.loc25_41.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 -// CHECK:STDOUT: %.loc24_49.1: type = splice_block %.loc24_49.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_49: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_49: init type = call constants.%Float(%int_64.loc24_49) [template = f64] -// CHECK:STDOUT: %.loc24_49.2: type = value_of_initializer %float.make_type.loc24_49 [template = f64] -// CHECK:STDOUT: %.loc24_49.3: type = converted %float.make_type.loc24_49, %.loc24_49.2 [template = f64] +// CHECK:STDOUT: %.loc25_49.1: type = splice_block %.loc25_49.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc25_49: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_49: init type = call constants.%Float(%int_64.loc25_49) [template = f64] +// CHECK:STDOUT: %.loc25_49.2: type = value_of_initializer %float.make_type.loc25_49 [template = f64] +// CHECK:STDOUT: %.loc25_49.3: type = converted %float.make_type.loc25_49, %.loc25_49.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 @@ -431,22 +432,22 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc28_55.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc28_55.2: type = converted %bool.make_type, %.loc28_55.1 [template = bool] +// CHECK:STDOUT: %.loc29_55.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc29_55.2: type = converted %bool.make_type, %.loc29_55.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc28_39.1: type = splice_block %.loc28_39.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_39: init type = call constants.%Float(%int_64.loc28_39) [template = f64] -// CHECK:STDOUT: %.loc28_39.2: type = value_of_initializer %float.make_type.loc28_39 [template = f64] -// CHECK:STDOUT: %.loc28_39.3: type = converted %float.make_type.loc28_39, %.loc28_39.2 [template = f64] +// CHECK:STDOUT: %.loc29_39.1: type = splice_block %.loc29_39.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc29_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc29_39: init type = call constants.%Float(%int_64.loc29_39) [template = f64] +// CHECK:STDOUT: %.loc29_39.2: type = value_of_initializer %float.make_type.loc29_39 [template = f64] +// CHECK:STDOUT: %.loc29_39.3: type = converted %float.make_type.loc29_39, %.loc29_39.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc28_47.1: type = splice_block %.loc28_47.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_47: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_47: init type = call constants.%Float(%int_64.loc28_47) [template = f64] -// CHECK:STDOUT: %.loc28_47.2: type = value_of_initializer %float.make_type.loc28_47 [template = f64] -// CHECK:STDOUT: %.loc28_47.3: type = converted %float.make_type.loc28_47, %.loc28_47.2 [template = f64] +// CHECK:STDOUT: %.loc29_47.1: type = splice_block %.loc29_47.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc29_47: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc29_47: init type = call constants.%Float(%int_64.loc29_47) [template = f64] +// CHECK:STDOUT: %.loc29_47.2: type = value_of_initializer %float.make_type.loc29_47 [template = f64] +// CHECK:STDOUT: %.loc29_47.3: type = converted %float.make_type.loc29_47, %.loc29_47.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -467,9 +468,9 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a // CHECK:STDOUT: %TooFew.call: init f64 = call %TooFew.ref(%a.ref) -// CHECK:STDOUT: %.loc21_19.1: f64 = value_of_initializer %TooFew.call -// CHECK:STDOUT: %.loc21_19.2: f64 = converted %TooFew.call, %.loc21_19.1 -// CHECK:STDOUT: return %.loc21_19.2 +// CHECK:STDOUT: %.loc22_19.1: f64 = value_of_initializer %TooFew.call +// CHECK:STDOUT: %.loc22_19.2: f64 = converted %TooFew.call, %.loc22_19.1 +// CHECK:STDOUT: return %.loc22_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCallIsValidTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { @@ -479,9 +480,9 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %b.ref: f64 = name_ref b, %b // CHECK:STDOUT: %c.ref: f64 = name_ref c, %c // CHECK:STDOUT: %TooMany.call: init f64 = call %TooMany.ref(%a.ref, %b.ref, %c.ref) -// CHECK:STDOUT: %.loc25_26.1: f64 = value_of_initializer %TooMany.call -// CHECK:STDOUT: %.loc25_26.2: f64 = converted %TooMany.call, %.loc25_26.1 -// CHECK:STDOUT: return %.loc25_26.2 +// CHECK:STDOUT: %.loc26_26.1: f64 = value_of_initializer %TooMany.call +// CHECK:STDOUT: %.loc26_26.2: f64 = converted %TooMany.call, %.loc26_26.1 +// CHECK:STDOUT: return %.loc26_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCallIsValidBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { @@ -490,8 +491,8 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a // CHECK:STDOUT: %b.ref: f64 = name_ref b, %b // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc29_29.1: bool = value_of_initializer %BadReturnType.call -// CHECK:STDOUT: %.loc29_29.2: bool = converted %BadReturnType.call, %.loc29_29.1 -// CHECK:STDOUT: return %.loc29_29.2 +// CHECK:STDOUT: %.loc30_29.1: bool = value_of_initializer %BadReturnType.call +// CHECK:STDOUT: %.loc30_29.2: bool = converted %BadReturnType.call, %.loc30_29.1 +// CHECK:STDOUT: return %.loc30_29.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/eq.carbon b/toolchain/check/testdata/builtins/float/eq.carbon index 1b4ffa527503..cd35b3bc03db 100644 --- a/toolchain/check/testdata/builtins/float/eq.carbon +++ b/toolchain/check/testdata/builtins/float/eq.carbon @@ -28,9 +28,10 @@ fn RuntimeCallIsValid(a: f64, b: f64) -> bool { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.eq" [InvalidBuiltinSignature] +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.eq" [InvalidBuiltinSignature] // CHECK:STDERR: fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: --- float_eq.carbon @@ -251,24 +252,24 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc7_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc7_35: init type = call constants.%Float(%int_64.loc7_35) [template = f64] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %float.make_type.loc7_35 [template = f64] -// CHECK:STDOUT: %.loc7_35.2: type = converted %float.make_type.loc7_35, %.loc7_35.1 [template = f64] +// CHECK:STDOUT: %int_64.loc8_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc8_35: init type = call constants.%Float(%int_64.loc8_35) [template = f64] +// CHECK:STDOUT: %.loc8_35.1: type = value_of_initializer %float.make_type.loc8_35 [template = f64] +// CHECK:STDOUT: %.loc8_35.2: type = converted %float.make_type.loc8_35, %.loc8_35.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19.1: type = splice_block %.loc7_19.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc7_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc7_19: init type = call constants.%Float(%int_64.loc7_19) [template = f64] -// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %float.make_type.loc7_19 [template = f64] -// CHECK:STDOUT: %.loc7_19.3: type = converted %float.make_type.loc7_19, %.loc7_19.2 [template = f64] +// CHECK:STDOUT: %.loc8_19.1: type = splice_block %.loc8_19.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc8_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc8_19: init type = call constants.%Float(%int_64.loc8_19) [template = f64] +// CHECK:STDOUT: %.loc8_19.2: type = value_of_initializer %float.make_type.loc8_19 [template = f64] +// CHECK:STDOUT: %.loc8_19.3: type = converted %float.make_type.loc8_19, %.loc8_19.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27.1: type = splice_block %.loc7_27.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc7_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc7_27: init type = call constants.%Float(%int_64.loc7_27) [template = f64] -// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %float.make_type.loc7_27 [template = f64] -// CHECK:STDOUT: %.loc7_27.3: type = converted %float.make_type.loc7_27, %.loc7_27.2 [template = f64] +// CHECK:STDOUT: %.loc8_27.1: type = splice_block %.loc8_27.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc8_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc8_27: init type = call constants.%Float(%int_64.loc8_27) [template = f64] +// CHECK:STDOUT: %.loc8_27.2: type = value_of_initializer %float.make_type.loc8_27 [template = f64] +// CHECK:STDOUT: %.loc8_27.3: type = converted %float.make_type.loc8_27, %.loc8_27.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index 13d026d82539..29bdd34a6db6 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -39,9 +39,10 @@ import library "types"; var invalid_float: Float(32); var dyn_size: i32 = 64; -// CHECK:STDERR: fail_invalid_size.carbon:[[@LINE+3]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] +// CHECK:STDERR: fail_invalid_size.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] // CHECK:STDERR: var dyn: Float(dyn_size); // CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: var dyn: Float(dyn_size); // CHECK:STDOUT: --- types.carbon diff --git a/toolchain/check/testdata/builtins/float/mul.carbon b/toolchain/check/testdata/builtins/float/mul.carbon index ac1c6df53f0d..1b91402214b8 100644 --- a/toolchain/check/testdata/builtins/float/mul.carbon +++ b/toolchain/check/testdata/builtins/float/mul.carbon @@ -32,9 +32,10 @@ fn TooFew(a: f64) -> f64 = "float.mul"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.mul"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.mul" [InvalidBuiltinSignature] +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.mul" [InvalidBuiltinSignature] // CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.mul"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.mul"; fn JustRight(a: f64, b: f64) -> f64 = "float.mul"; @@ -286,22 +287,22 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type, %.loc17_37.1 [template = bool] +// CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc17_21.1: type = splice_block %.loc17_21.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc17_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%int_64.loc17_21) [template = f64] -// CHECK:STDOUT: %.loc17_21.2: type = value_of_initializer %float.make_type.loc17_21 [template = f64] -// CHECK:STDOUT: %.loc17_21.3: type = converted %float.make_type.loc17_21, %.loc17_21.2 [template = f64] +// CHECK:STDOUT: %.loc18_21.1: type = splice_block %.loc18_21.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_21: init type = call constants.%Float(%int_64.loc18_21) [template = f64] +// CHECK:STDOUT: %.loc18_21.2: type = value_of_initializer %float.make_type.loc18_21 [template = f64] +// CHECK:STDOUT: %.loc18_21.3: type = converted %float.make_type.loc18_21, %.loc18_21.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc17_29.1: type = splice_block %.loc17_29.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc17_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%int_64.loc17_29) [template = f64] -// CHECK:STDOUT: %.loc17_29.2: type = value_of_initializer %float.make_type.loc17_29 [template = f64] -// CHECK:STDOUT: %.loc17_29.3: type = converted %float.make_type.loc17_29, %.loc17_29.2 [template = f64] +// CHECK:STDOUT: %.loc18_29.1: type = splice_block %.loc18_29.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_29: init type = call constants.%Float(%int_64.loc18_29) [template = f64] +// CHECK:STDOUT: %.loc18_29.2: type = value_of_initializer %float.make_type.loc18_29 [template = f64] +// CHECK:STDOUT: %.loc18_29.3: type = converted %float.make_type.loc18_29, %.loc18_29.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -315,24 +316,24 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc18_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_33: init type = call constants.%Float(%int_64.loc18_33) [template = f64] -// CHECK:STDOUT: %.loc18_33.1: type = value_of_initializer %float.make_type.loc18_33 [template = f64] -// CHECK:STDOUT: %.loc18_33.2: type = converted %float.make_type.loc18_33, %.loc18_33.1 [template = f64] +// CHECK:STDOUT: %int_64.loc19_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc19_33: init type = call constants.%Float(%int_64.loc19_33) [template = f64] +// CHECK:STDOUT: %.loc19_33.1: type = value_of_initializer %float.make_type.loc19_33 [template = f64] +// CHECK:STDOUT: %.loc19_33.2: type = converted %float.make_type.loc19_33, %.loc19_33.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc18_17.1: type = splice_block %.loc18_17.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc18_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%int_64.loc18_17) [template = f64] -// CHECK:STDOUT: %.loc18_17.2: type = value_of_initializer %float.make_type.loc18_17 [template = f64] -// CHECK:STDOUT: %.loc18_17.3: type = converted %float.make_type.loc18_17, %.loc18_17.2 [template = f64] +// CHECK:STDOUT: %.loc19_17.1: type = splice_block %.loc19_17.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc19_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc19_17: init type = call constants.%Float(%int_64.loc19_17) [template = f64] +// CHECK:STDOUT: %.loc19_17.2: type = value_of_initializer %float.make_type.loc19_17 [template = f64] +// CHECK:STDOUT: %.loc19_17.3: type = converted %float.make_type.loc19_17, %.loc19_17.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc18_25.1: type = splice_block %.loc18_25.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc18_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%int_64.loc18_25) [template = f64] -// CHECK:STDOUT: %.loc18_25.2: type = value_of_initializer %float.make_type.loc18_25 [template = f64] -// CHECK:STDOUT: %.loc18_25.3: type = converted %float.make_type.loc18_25, %.loc18_25.2 [template = f64] +// CHECK:STDOUT: %.loc19_25.1: type = splice_block %.loc19_25.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc19_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc19_25: init type = call constants.%Float(%int_64.loc19_25) [template = f64] +// CHECK:STDOUT: %.loc19_25.2: type = value_of_initializer %float.make_type.loc19_25 [template = f64] +// CHECK:STDOUT: %.loc19_25.3: type = converted %float.make_type.loc19_25, %.loc19_25.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 @@ -344,16 +345,16 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc20_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_40: init type = call constants.%Float(%int_64.loc20_40) [template = f64] -// CHECK:STDOUT: %.loc20_40.1: type = value_of_initializer %float.make_type.loc20_40 [template = f64] -// CHECK:STDOUT: %.loc20_40.2: type = converted %float.make_type.loc20_40, %.loc20_40.1 [template = f64] +// CHECK:STDOUT: %int_64.loc21_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc21_40: init type = call constants.%Float(%int_64.loc21_40) [template = f64] +// CHECK:STDOUT: %.loc21_40.1: type = value_of_initializer %float.make_type.loc21_40 [template = f64] +// CHECK:STDOUT: %.loc21_40.2: type = converted %float.make_type.loc21_40, %.loc21_40.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc20_32.1: type = splice_block %.loc20_32.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc20_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_32: init type = call constants.%Float(%int_64.loc20_32) [template = f64] -// CHECK:STDOUT: %.loc20_32.2: type = value_of_initializer %float.make_type.loc20_32 [template = f64] -// CHECK:STDOUT: %.loc20_32.3: type = converted %float.make_type.loc20_32, %.loc20_32.2 [template = f64] +// CHECK:STDOUT: %.loc21_32.1: type = splice_block %.loc21_32.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc21_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc21_32: init type = call constants.%Float(%int_64.loc21_32) [template = f64] +// CHECK:STDOUT: %.loc21_32.2: type = value_of_initializer %float.make_type.loc21_32 [template = f64] +// CHECK:STDOUT: %.loc21_32.3: type = converted %float.make_type.loc21_32, %.loc21_32.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 @@ -369,32 +370,32 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc24_57: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_57: init type = call constants.%Float(%int_64.loc24_57) [template = f64] -// CHECK:STDOUT: %.loc24_57.1: type = value_of_initializer %float.make_type.loc24_57 [template = f64] -// CHECK:STDOUT: %.loc24_57.2: type = converted %float.make_type.loc24_57, %.loc24_57.1 [template = f64] +// CHECK:STDOUT: %int_64.loc25_57: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_57: init type = call constants.%Float(%int_64.loc25_57) [template = f64] +// CHECK:STDOUT: %.loc25_57.1: type = value_of_initializer %float.make_type.loc25_57 [template = f64] +// CHECK:STDOUT: %.loc25_57.2: type = converted %float.make_type.loc25_57, %.loc25_57.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc24_33.1: type = splice_block %.loc24_33.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_33: init type = call constants.%Float(%int_64.loc24_33) [template = f64] -// CHECK:STDOUT: %.loc24_33.2: type = value_of_initializer %float.make_type.loc24_33 [template = f64] -// CHECK:STDOUT: %.loc24_33.3: type = converted %float.make_type.loc24_33, %.loc24_33.2 [template = f64] +// CHECK:STDOUT: %.loc25_33.1: type = splice_block %.loc25_33.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc25_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_33: init type = call constants.%Float(%int_64.loc25_33) [template = f64] +// CHECK:STDOUT: %.loc25_33.2: type = value_of_initializer %float.make_type.loc25_33 [template = f64] +// CHECK:STDOUT: %.loc25_33.3: type = converted %float.make_type.loc25_33, %.loc25_33.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc24_41.1: type = splice_block %.loc24_41.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_41: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_41: init type = call constants.%Float(%int_64.loc24_41) [template = f64] -// CHECK:STDOUT: %.loc24_41.2: type = value_of_initializer %float.make_type.loc24_41 [template = f64] -// CHECK:STDOUT: %.loc24_41.3: type = converted %float.make_type.loc24_41, %.loc24_41.2 [template = f64] +// CHECK:STDOUT: %.loc25_41.1: type = splice_block %.loc25_41.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc25_41: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_41: init type = call constants.%Float(%int_64.loc25_41) [template = f64] +// CHECK:STDOUT: %.loc25_41.2: type = value_of_initializer %float.make_type.loc25_41 [template = f64] +// CHECK:STDOUT: %.loc25_41.3: type = converted %float.make_type.loc25_41, %.loc25_41.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 -// CHECK:STDOUT: %.loc24_49.1: type = splice_block %.loc24_49.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_49: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_49: init type = call constants.%Float(%int_64.loc24_49) [template = f64] -// CHECK:STDOUT: %.loc24_49.2: type = value_of_initializer %float.make_type.loc24_49 [template = f64] -// CHECK:STDOUT: %.loc24_49.3: type = converted %float.make_type.loc24_49, %.loc24_49.2 [template = f64] +// CHECK:STDOUT: %.loc25_49.1: type = splice_block %.loc25_49.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc25_49: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_49: init type = call constants.%Float(%int_64.loc25_49) [template = f64] +// CHECK:STDOUT: %.loc25_49.2: type = value_of_initializer %float.make_type.loc25_49 [template = f64] +// CHECK:STDOUT: %.loc25_49.3: type = converted %float.make_type.loc25_49, %.loc25_49.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 @@ -409,22 +410,22 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc28_55.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc28_55.2: type = converted %bool.make_type, %.loc28_55.1 [template = bool] +// CHECK:STDOUT: %.loc29_55.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc29_55.2: type = converted %bool.make_type, %.loc29_55.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc28_39.1: type = splice_block %.loc28_39.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_39: init type = call constants.%Float(%int_64.loc28_39) [template = f64] -// CHECK:STDOUT: %.loc28_39.2: type = value_of_initializer %float.make_type.loc28_39 [template = f64] -// CHECK:STDOUT: %.loc28_39.3: type = converted %float.make_type.loc28_39, %.loc28_39.2 [template = f64] +// CHECK:STDOUT: %.loc29_39.1: type = splice_block %.loc29_39.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc29_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc29_39: init type = call constants.%Float(%int_64.loc29_39) [template = f64] +// CHECK:STDOUT: %.loc29_39.2: type = value_of_initializer %float.make_type.loc29_39 [template = f64] +// CHECK:STDOUT: %.loc29_39.3: type = converted %float.make_type.loc29_39, %.loc29_39.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc28_47.1: type = splice_block %.loc28_47.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_47: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_47: init type = call constants.%Float(%int_64.loc28_47) [template = f64] -// CHECK:STDOUT: %.loc28_47.2: type = value_of_initializer %float.make_type.loc28_47 [template = f64] -// CHECK:STDOUT: %.loc28_47.3: type = converted %float.make_type.loc28_47, %.loc28_47.2 [template = f64] +// CHECK:STDOUT: %.loc29_47.1: type = splice_block %.loc29_47.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc29_47: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc29_47: init type = call constants.%Float(%int_64.loc29_47) [template = f64] +// CHECK:STDOUT: %.loc29_47.2: type = value_of_initializer %float.make_type.loc29_47 [template = f64] +// CHECK:STDOUT: %.loc29_47.3: type = converted %float.make_type.loc29_47, %.loc29_47.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -445,9 +446,9 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a // CHECK:STDOUT: %TooFew.call: init f64 = call %TooFew.ref(%a.ref) -// CHECK:STDOUT: %.loc21_19.1: f64 = value_of_initializer %TooFew.call -// CHECK:STDOUT: %.loc21_19.2: f64 = converted %TooFew.call, %.loc21_19.1 -// CHECK:STDOUT: return %.loc21_19.2 +// CHECK:STDOUT: %.loc22_19.1: f64 = value_of_initializer %TooFew.call +// CHECK:STDOUT: %.loc22_19.2: f64 = converted %TooFew.call, %.loc22_19.1 +// CHECK:STDOUT: return %.loc22_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCallIsValidTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { @@ -457,9 +458,9 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %b.ref: f64 = name_ref b, %b // CHECK:STDOUT: %c.ref: f64 = name_ref c, %c // CHECK:STDOUT: %TooMany.call: init f64 = call %TooMany.ref(%a.ref, %b.ref, %c.ref) -// CHECK:STDOUT: %.loc25_26.1: f64 = value_of_initializer %TooMany.call -// CHECK:STDOUT: %.loc25_26.2: f64 = converted %TooMany.call, %.loc25_26.1 -// CHECK:STDOUT: return %.loc25_26.2 +// CHECK:STDOUT: %.loc26_26.1: f64 = value_of_initializer %TooMany.call +// CHECK:STDOUT: %.loc26_26.2: f64 = converted %TooMany.call, %.loc26_26.1 +// CHECK:STDOUT: return %.loc26_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCallIsValidBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { @@ -468,8 +469,8 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a // CHECK:STDOUT: %b.ref: f64 = name_ref b, %b // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc29_29.1: bool = value_of_initializer %BadReturnType.call -// CHECK:STDOUT: %.loc29_29.2: bool = converted %BadReturnType.call, %.loc29_29.1 -// CHECK:STDOUT: return %.loc29_29.2 +// CHECK:STDOUT: %.loc30_29.1: bool = value_of_initializer %BadReturnType.call +// CHECK:STDOUT: %.loc30_29.2: bool = converted %BadReturnType.call, %.loc30_29.1 +// CHECK:STDOUT: return %.loc30_29.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/negate.carbon b/toolchain/check/testdata/builtins/float/negate.carbon index 80a72e3b30c2..6f4100994e25 100644 --- a/toolchain/check/testdata/builtins/float/negate.carbon +++ b/toolchain/check/testdata/builtins/float/negate.carbon @@ -62,12 +62,13 @@ fn RuntimeCallIsValidTooMany(a: f64, b: f64, c: f64) -> f64 { } fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:10: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch] + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch] // CHECK:STDERR: return BadReturnType(a, b); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-29]]:1: note: calling function declared here [InCallToEntity] // CHECK:STDERR: fn BadReturnType(a: f64) -> bool = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: return BadReturnType(a, b); } diff --git a/toolchain/check/testdata/builtins/float/neq.carbon b/toolchain/check/testdata/builtins/float/neq.carbon index ea329f36962d..06c9c60d0901 100644 --- a/toolchain/check/testdata/builtins/float/neq.carbon +++ b/toolchain/check/testdata/builtins/float/neq.carbon @@ -28,9 +28,10 @@ fn RuntimeCallIsValid(a: f64, b: f64) -> bool { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.neq" [InvalidBuiltinSignature] +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.neq" [InvalidBuiltinSignature] // CHECK:STDERR: fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: --- float_neq.carbon @@ -251,24 +252,24 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc7_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc7_35: init type = call constants.%Float(%int_64.loc7_35) [template = f64] -// CHECK:STDOUT: %.loc7_35.1: type = value_of_initializer %float.make_type.loc7_35 [template = f64] -// CHECK:STDOUT: %.loc7_35.2: type = converted %float.make_type.loc7_35, %.loc7_35.1 [template = f64] +// CHECK:STDOUT: %int_64.loc8_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc8_35: init type = call constants.%Float(%int_64.loc8_35) [template = f64] +// CHECK:STDOUT: %.loc8_35.1: type = value_of_initializer %float.make_type.loc8_35 [template = f64] +// CHECK:STDOUT: %.loc8_35.2: type = converted %float.make_type.loc8_35, %.loc8_35.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19.1: type = splice_block %.loc7_19.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc7_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc7_19: init type = call constants.%Float(%int_64.loc7_19) [template = f64] -// CHECK:STDOUT: %.loc7_19.2: type = value_of_initializer %float.make_type.loc7_19 [template = f64] -// CHECK:STDOUT: %.loc7_19.3: type = converted %float.make_type.loc7_19, %.loc7_19.2 [template = f64] +// CHECK:STDOUT: %.loc8_19.1: type = splice_block %.loc8_19.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc8_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc8_19: init type = call constants.%Float(%int_64.loc8_19) [template = f64] +// CHECK:STDOUT: %.loc8_19.2: type = value_of_initializer %float.make_type.loc8_19 [template = f64] +// CHECK:STDOUT: %.loc8_19.3: type = converted %float.make_type.loc8_19, %.loc8_19.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27.1: type = splice_block %.loc7_27.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc7_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc7_27: init type = call constants.%Float(%int_64.loc7_27) [template = f64] -// CHECK:STDOUT: %.loc7_27.2: type = value_of_initializer %float.make_type.loc7_27 [template = f64] -// CHECK:STDOUT: %.loc7_27.3: type = converted %float.make_type.loc7_27, %.loc7_27.2 [template = f64] +// CHECK:STDOUT: %.loc8_27.1: type = splice_block %.loc8_27.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc8_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc8_27: init type = call constants.%Float(%int_64.loc8_27) [template = f64] +// CHECK:STDOUT: %.loc8_27.2: type = value_of_initializer %float.make_type.loc8_27 [template = f64] +// CHECK:STDOUT: %.loc8_27.3: type = converted %float.make_type.loc8_27, %.loc8_27.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 diff --git a/toolchain/check/testdata/builtins/float/sub.carbon b/toolchain/check/testdata/builtins/float/sub.carbon index 23f0b72356b9..cefc7dddcaa8 100644 --- a/toolchain/check/testdata/builtins/float/sub.carbon +++ b/toolchain/check/testdata/builtins/float/sub.carbon @@ -32,9 +32,10 @@ fn TooFew(a: f64) -> f64 = "float.sub"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.sub"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.sub" [InvalidBuiltinSignature] +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.sub" [InvalidBuiltinSignature] // CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.sub"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.sub"; fn JustRight(a: f64, b: f64) -> f64 = "float.sub"; @@ -286,22 +287,22 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc17_37.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type, %.loc17_37.1 [template = bool] +// CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc17_21.1: type = splice_block %.loc17_21.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc17_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%int_64.loc17_21) [template = f64] -// CHECK:STDOUT: %.loc17_21.2: type = value_of_initializer %float.make_type.loc17_21 [template = f64] -// CHECK:STDOUT: %.loc17_21.3: type = converted %float.make_type.loc17_21, %.loc17_21.2 [template = f64] +// CHECK:STDOUT: %.loc18_21.1: type = splice_block %.loc18_21.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_21: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_21: init type = call constants.%Float(%int_64.loc18_21) [template = f64] +// CHECK:STDOUT: %.loc18_21.2: type = value_of_initializer %float.make_type.loc18_21 [template = f64] +// CHECK:STDOUT: %.loc18_21.3: type = converted %float.make_type.loc18_21, %.loc18_21.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc17_29.1: type = splice_block %.loc17_29.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc17_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc17_29: init type = call constants.%Float(%int_64.loc17_29) [template = f64] -// CHECK:STDOUT: %.loc17_29.2: type = value_of_initializer %float.make_type.loc17_29 [template = f64] -// CHECK:STDOUT: %.loc17_29.3: type = converted %float.make_type.loc17_29, %.loc17_29.2 [template = f64] +// CHECK:STDOUT: %.loc18_29.1: type = splice_block %.loc18_29.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc18_29: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc18_29: init type = call constants.%Float(%int_64.loc18_29) [template = f64] +// CHECK:STDOUT: %.loc18_29.2: type = value_of_initializer %float.make_type.loc18_29 [template = f64] +// CHECK:STDOUT: %.loc18_29.3: type = converted %float.make_type.loc18_29, %.loc18_29.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -315,24 +316,24 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc18_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_33: init type = call constants.%Float(%int_64.loc18_33) [template = f64] -// CHECK:STDOUT: %.loc18_33.1: type = value_of_initializer %float.make_type.loc18_33 [template = f64] -// CHECK:STDOUT: %.loc18_33.2: type = converted %float.make_type.loc18_33, %.loc18_33.1 [template = f64] +// CHECK:STDOUT: %int_64.loc19_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc19_33: init type = call constants.%Float(%int_64.loc19_33) [template = f64] +// CHECK:STDOUT: %.loc19_33.1: type = value_of_initializer %float.make_type.loc19_33 [template = f64] +// CHECK:STDOUT: %.loc19_33.2: type = converted %float.make_type.loc19_33, %.loc19_33.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc18_17.1: type = splice_block %.loc18_17.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc18_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%int_64.loc18_17) [template = f64] -// CHECK:STDOUT: %.loc18_17.2: type = value_of_initializer %float.make_type.loc18_17 [template = f64] -// CHECK:STDOUT: %.loc18_17.3: type = converted %float.make_type.loc18_17, %.loc18_17.2 [template = f64] +// CHECK:STDOUT: %.loc19_17.1: type = splice_block %.loc19_17.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc19_17: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc19_17: init type = call constants.%Float(%int_64.loc19_17) [template = f64] +// CHECK:STDOUT: %.loc19_17.2: type = value_of_initializer %float.make_type.loc19_17 [template = f64] +// CHECK:STDOUT: %.loc19_17.3: type = converted %float.make_type.loc19_17, %.loc19_17.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc18_25.1: type = splice_block %.loc18_25.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc18_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc18_25: init type = call constants.%Float(%int_64.loc18_25) [template = f64] -// CHECK:STDOUT: %.loc18_25.2: type = value_of_initializer %float.make_type.loc18_25 [template = f64] -// CHECK:STDOUT: %.loc18_25.3: type = converted %float.make_type.loc18_25, %.loc18_25.2 [template = f64] +// CHECK:STDOUT: %.loc19_25.1: type = splice_block %.loc19_25.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc19_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc19_25: init type = call constants.%Float(%int_64.loc19_25) [template = f64] +// CHECK:STDOUT: %.loc19_25.2: type = value_of_initializer %float.make_type.loc19_25 [template = f64] +// CHECK:STDOUT: %.loc19_25.3: type = converted %float.make_type.loc19_25, %.loc19_25.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 @@ -344,16 +345,16 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc20_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_40: init type = call constants.%Float(%int_64.loc20_40) [template = f64] -// CHECK:STDOUT: %.loc20_40.1: type = value_of_initializer %float.make_type.loc20_40 [template = f64] -// CHECK:STDOUT: %.loc20_40.2: type = converted %float.make_type.loc20_40, %.loc20_40.1 [template = f64] +// CHECK:STDOUT: %int_64.loc21_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc21_40: init type = call constants.%Float(%int_64.loc21_40) [template = f64] +// CHECK:STDOUT: %.loc21_40.1: type = value_of_initializer %float.make_type.loc21_40 [template = f64] +// CHECK:STDOUT: %.loc21_40.2: type = converted %float.make_type.loc21_40, %.loc21_40.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc20_32.1: type = splice_block %.loc20_32.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc20_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_32: init type = call constants.%Float(%int_64.loc20_32) [template = f64] -// CHECK:STDOUT: %.loc20_32.2: type = value_of_initializer %float.make_type.loc20_32 [template = f64] -// CHECK:STDOUT: %.loc20_32.3: type = converted %float.make_type.loc20_32, %.loc20_32.2 [template = f64] +// CHECK:STDOUT: %.loc21_32.1: type = splice_block %.loc21_32.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc21_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc21_32: init type = call constants.%Float(%int_64.loc21_32) [template = f64] +// CHECK:STDOUT: %.loc21_32.2: type = value_of_initializer %float.make_type.loc21_32 [template = f64] +// CHECK:STDOUT: %.loc21_32.3: type = converted %float.make_type.loc21_32, %.loc21_32.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 @@ -369,32 +370,32 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc24_57: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_57: init type = call constants.%Float(%int_64.loc24_57) [template = f64] -// CHECK:STDOUT: %.loc24_57.1: type = value_of_initializer %float.make_type.loc24_57 [template = f64] -// CHECK:STDOUT: %.loc24_57.2: type = converted %float.make_type.loc24_57, %.loc24_57.1 [template = f64] +// CHECK:STDOUT: %int_64.loc25_57: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_57: init type = call constants.%Float(%int_64.loc25_57) [template = f64] +// CHECK:STDOUT: %.loc25_57.1: type = value_of_initializer %float.make_type.loc25_57 [template = f64] +// CHECK:STDOUT: %.loc25_57.2: type = converted %float.make_type.loc25_57, %.loc25_57.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc24_33.1: type = splice_block %.loc24_33.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_33: init type = call constants.%Float(%int_64.loc24_33) [template = f64] -// CHECK:STDOUT: %.loc24_33.2: type = value_of_initializer %float.make_type.loc24_33 [template = f64] -// CHECK:STDOUT: %.loc24_33.3: type = converted %float.make_type.loc24_33, %.loc24_33.2 [template = f64] +// CHECK:STDOUT: %.loc25_33.1: type = splice_block %.loc25_33.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc25_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_33: init type = call constants.%Float(%int_64.loc25_33) [template = f64] +// CHECK:STDOUT: %.loc25_33.2: type = value_of_initializer %float.make_type.loc25_33 [template = f64] +// CHECK:STDOUT: %.loc25_33.3: type = converted %float.make_type.loc25_33, %.loc25_33.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc24_41.1: type = splice_block %.loc24_41.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_41: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_41: init type = call constants.%Float(%int_64.loc24_41) [template = f64] -// CHECK:STDOUT: %.loc24_41.2: type = value_of_initializer %float.make_type.loc24_41 [template = f64] -// CHECK:STDOUT: %.loc24_41.3: type = converted %float.make_type.loc24_41, %.loc24_41.2 [template = f64] +// CHECK:STDOUT: %.loc25_41.1: type = splice_block %.loc25_41.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc25_41: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_41: init type = call constants.%Float(%int_64.loc25_41) [template = f64] +// CHECK:STDOUT: %.loc25_41.2: type = value_of_initializer %float.make_type.loc25_41 [template = f64] +// CHECK:STDOUT: %.loc25_41.3: type = converted %float.make_type.loc25_41, %.loc25_41.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 -// CHECK:STDOUT: %.loc24_49.1: type = splice_block %.loc24_49.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_49: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_49: init type = call constants.%Float(%int_64.loc24_49) [template = f64] -// CHECK:STDOUT: %.loc24_49.2: type = value_of_initializer %float.make_type.loc24_49 [template = f64] -// CHECK:STDOUT: %.loc24_49.3: type = converted %float.make_type.loc24_49, %.loc24_49.2 [template = f64] +// CHECK:STDOUT: %.loc25_49.1: type = splice_block %.loc25_49.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc25_49: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc25_49: init type = call constants.%Float(%int_64.loc25_49) [template = f64] +// CHECK:STDOUT: %.loc25_49.2: type = value_of_initializer %float.make_type.loc25_49 [template = f64] +// CHECK:STDOUT: %.loc25_49.3: type = converted %float.make_type.loc25_49, %.loc25_49.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 @@ -409,22 +410,22 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc28_55.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc28_55.2: type = converted %bool.make_type, %.loc28_55.1 [template = bool] +// CHECK:STDOUT: %.loc29_55.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc29_55.2: type = converted %bool.make_type, %.loc29_55.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc28_39.1: type = splice_block %.loc28_39.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_39: init type = call constants.%Float(%int_64.loc28_39) [template = f64] -// CHECK:STDOUT: %.loc28_39.2: type = value_of_initializer %float.make_type.loc28_39 [template = f64] -// CHECK:STDOUT: %.loc28_39.3: type = converted %float.make_type.loc28_39, %.loc28_39.2 [template = f64] +// CHECK:STDOUT: %.loc29_39.1: type = splice_block %.loc29_39.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc29_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc29_39: init type = call constants.%Float(%int_64.loc29_39) [template = f64] +// CHECK:STDOUT: %.loc29_39.2: type = value_of_initializer %float.make_type.loc29_39 [template = f64] +// CHECK:STDOUT: %.loc29_39.3: type = converted %float.make_type.loc29_39, %.loc29_39.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc28_47.1: type = splice_block %.loc28_47.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_47: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_47: init type = call constants.%Float(%int_64.loc28_47) [template = f64] -// CHECK:STDOUT: %.loc28_47.2: type = value_of_initializer %float.make_type.loc28_47 [template = f64] -// CHECK:STDOUT: %.loc28_47.3: type = converted %float.make_type.loc28_47, %.loc28_47.2 [template = f64] +// CHECK:STDOUT: %.loc29_47.1: type = splice_block %.loc29_47.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc29_47: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc29_47: init type = call constants.%Float(%int_64.loc29_47) [template = f64] +// CHECK:STDOUT: %.loc29_47.2: type = value_of_initializer %float.make_type.loc29_47 [template = f64] +// CHECK:STDOUT: %.loc29_47.3: type = converted %float.make_type.loc29_47, %.loc29_47.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -445,9 +446,9 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a // CHECK:STDOUT: %TooFew.call: init f64 = call %TooFew.ref(%a.ref) -// CHECK:STDOUT: %.loc21_19.1: f64 = value_of_initializer %TooFew.call -// CHECK:STDOUT: %.loc21_19.2: f64 = converted %TooFew.call, %.loc21_19.1 -// CHECK:STDOUT: return %.loc21_19.2 +// CHECK:STDOUT: %.loc22_19.1: f64 = value_of_initializer %TooFew.call +// CHECK:STDOUT: %.loc22_19.2: f64 = converted %TooFew.call, %.loc22_19.1 +// CHECK:STDOUT: return %.loc22_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCallIsValidTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { @@ -457,9 +458,9 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %b.ref: f64 = name_ref b, %b // CHECK:STDOUT: %c.ref: f64 = name_ref c, %c // CHECK:STDOUT: %TooMany.call: init f64 = call %TooMany.ref(%a.ref, %b.ref, %c.ref) -// CHECK:STDOUT: %.loc25_26.1: f64 = value_of_initializer %TooMany.call -// CHECK:STDOUT: %.loc25_26.2: f64 = converted %TooMany.call, %.loc25_26.1 -// CHECK:STDOUT: return %.loc25_26.2 +// CHECK:STDOUT: %.loc26_26.1: f64 = value_of_initializer %TooMany.call +// CHECK:STDOUT: %.loc26_26.2: f64 = converted %TooMany.call, %.loc26_26.1 +// CHECK:STDOUT: return %.loc26_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @RuntimeCallIsValidBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { @@ -468,8 +469,8 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a // CHECK:STDOUT: %b.ref: f64 = name_ref b, %b // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc29_29.1: bool = value_of_initializer %BadReturnType.call -// CHECK:STDOUT: %.loc29_29.2: bool = converted %BadReturnType.call, %.loc29_29.1 -// CHECK:STDOUT: return %.loc29_29.2 +// CHECK:STDOUT: %.loc30_29.1: bool = value_of_initializer %BadReturnType.call +// CHECK:STDOUT: %.loc30_29.2: bool = converted %BadReturnType.call, %.loc30_29.1 +// CHECK:STDOUT: return %.loc30_29.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/and.carbon b/toolchain/check/testdata/builtins/int/and.carbon index 944f35971a04..f624ff011d09 100644 --- a/toolchain/check/testdata/builtins/int/and.carbon +++ b/toolchain/check/testdata/builtins/int/and.carbon @@ -111,11 +111,12 @@ fn Test(n: Core.IntLiteral()) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: And(1, n); - // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+6]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] + // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: And(n, n); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE-24]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: fn And(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.and"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: And(n, n); } diff --git a/toolchain/check/testdata/builtins/int/complement.carbon b/toolchain/check/testdata/builtins/int/complement.carbon index 7fddbd691d72..a40d2c6960ba 100644 --- a/toolchain/check/testdata/builtins/int/complement.carbon +++ b/toolchain/check/testdata/builtins/int/complement.carbon @@ -50,11 +50,12 @@ library "[[@TEST_NAME]]"; fn Complement(a: Core.IntLiteral()) -> Core.IntLiteral() = "int.complement"; fn F(a: Core.IntLiteral()) -> Core.IntLiteral() { - // CHECK:STDERR: fail_literal_runtime.carbon:[[@LINE+6]]:10: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] + // CHECK:STDERR: fail_literal_runtime.carbon:[[@LINE+7]]:10: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: return Complement(a); // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_literal_runtime.carbon:[[@LINE-6]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: fn Complement(a: Core.IntLiteral()) -> Core.IntLiteral() = "int.complement"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: return Complement(a); } diff --git a/toolchain/check/testdata/builtins/int/convert.carbon b/toolchain/check/testdata/builtins/int/convert.carbon index 91970fadfaee..624472f71dd7 100644 --- a/toolchain/check/testdata/builtins/int/convert.carbon +++ b/toolchain/check/testdata/builtins/int/convert.carbon @@ -216,11 +216,12 @@ import library "int_ops"; let not_constant: Core.IntLiteral() = 0; -// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+7]]:33: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] +// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+8]]:33: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: let convert_not_constant: i16 = IntLiteralToInt16(not_constant); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_not_constant.carbon:[[@LINE-7]]:1: in import [InImport] // CHECK:STDERR: int_ops.carbon:16:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: fn IntLiteralToInt16(a: Core.IntLiteral()) -> i16 = "int.convert"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: let convert_not_constant: i16 = IntLiteralToInt16(not_constant); diff --git a/toolchain/check/testdata/builtins/int/convert_checked.carbon b/toolchain/check/testdata/builtins/int/convert_checked.carbon index ec0a6a84f18f..83201ee3997f 100644 --- a/toolchain/check/testdata/builtins/int/convert_checked.carbon +++ b/toolchain/check/testdata/builtins/int/convert_checked.carbon @@ -241,11 +241,12 @@ let convert_not_constant_narrow: i16 = Int32ToInt16(not_constant); // CHECK:STDERR: let convert_not_constant_same: i32 = Int32ToInt32(not_constant); -// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+7]]:39: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] +// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+8]]:39: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_not_constant.carbon:[[@LINE-27]]:1: in import [InImport] // CHECK:STDERR: int_ops.carbon:26:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: fn Int32ToInt64(a: i32) -> i64 = "int.convert_checked"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index efea56401882..ebc625f9288b 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -95,11 +95,12 @@ fn Test(n: Core.IntLiteral()) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Eq(1, n); - // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+6]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] + // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: Eq(n, n); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE-24]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: fn Eq(a: Core.IntLiteral(), b: Core.IntLiteral()) -> bool = "int.eq"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: Eq(n, n); } diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index b749abe4942f..e47f73cb5a32 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -215,10 +215,11 @@ let bad2: Core.IntLiteral() = LeftShiftOfLit(a_lit, an_i32); let bad3: i32 = LeftShiftByLit(an_i32, 12); // TODO: This could be valid because we don't actually need the return value at runtime. -// CHECK:STDERR: fail_comp_time_only_shift.carbon:[[@LINE+6]]:31: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] +// CHECK:STDERR: fail_comp_time_only_shift.carbon:[[@LINE+7]]:31: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: let bad4: Core.IntLiteral() = LeftShiftOfLit(12, an_i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_comp_time_only_shift.carbon:[[@LINE-39]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: fn LeftShiftOfLit(a: Core.IntLiteral(), b: i32) -> Core.IntLiteral() = "int.left_shift"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: let bad4: Core.IntLiteral() = LeftShiftOfLit(12, an_i32); diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index 7b170bfd06de..72a4daa8406d 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -93,11 +93,12 @@ fn Test(n: Core.IntLiteral()) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: LessEq(1, n); - // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+6]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] + // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: LessEq(n, n); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE-24]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: fn LessEq(a: Core.IntLiteral(), b: Core.IntLiteral()) -> bool = "int.less_eq"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: LessEq(n, n); } diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index d03c14120350..94d13271a191 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -86,7 +86,8 @@ library "[[@TEST_NAME]]"; import library "types"; -// CHECK:STDERR: fail_oversized.carbon:[[@LINE+3]]:8: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 [IntWidthTooLarge] +// CHECK:STDERR: fail_oversized.carbon:[[@LINE+4]]:8: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 [IntWidthTooLarge] // CHECK:STDERR: var m: Int(1000000000); // CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: var m: Int(1000000000); diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index 6fc8961c2a12..44a1511e7291 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -67,7 +67,8 @@ library "[[@TEST_NAME]]"; import library "types"; -// CHECK:STDERR: fail_oversized.carbon:[[@LINE+3]]:8: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 [IntWidthTooLarge] +// CHECK:STDERR: fail_oversized.carbon:[[@LINE+4]]:8: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 [IntWidthTooLarge] // CHECK:STDERR: var m: UInt(1000000000); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ +// CHECK:STDERR: var m: UInt(1000000000); diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index 6581455108fb..0104d41079b9 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -122,7 +122,8 @@ let negative_zero: i32 = RightShift(0, -1); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: let negative_lit: Core.IntLiteral() = RightShiftLit(1, -1); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+3]]:44: error: shift distance negative in `0 >> -1` [CompileTimeShiftNegative] +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:44: error: shift distance negative in `0 >> -1` [CompileTimeShiftNegative] // CHECK:STDERR: let negative_lit_zero: Core.IntLiteral() = RightShiftLit(0, -1); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: let negative_lit_zero: Core.IntLiteral() = RightShiftLit(0, -1); diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index 794ec245313a..45aa2db79c66 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -138,7 +138,8 @@ package FailOverflow; fn Add(a: i32, b: i32) -> i32 = "int.sadd"; let a: i32 = Add(0x7FFFFFFF, 0); -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error: integer overflow in calculation `2147483647 + 1` [CompileTimeIntegerOverflow] +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:14: error: integer overflow in calculation `2147483647 + 1` [CompileTimeIntegerOverflow] // CHECK:STDERR: let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: let b: i32 = Add(0x7FFFFFFF, 1); diff --git a/toolchain/check/testdata/builtins/int/sdiv.carbon b/toolchain/check/testdata/builtins/int/sdiv.carbon index f7c87e61ae4a..3de44450bb88 100644 --- a/toolchain/check/testdata/builtins/int/sdiv.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv.carbon @@ -82,7 +82,8 @@ let b: i32 = Div(0, 0); // CHECK:STDERR: let c: Core.IntLiteral() = DivLit(1, 0); -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:28: error: division by zero [CompileTimeDivisionByZero] +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:28: error: division by zero [CompileTimeDivisionByZero] // CHECK:STDERR: let d: Core.IntLiteral() = DivLit(0, 0); // CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: let d: Core.IntLiteral() = DivLit(0, 0); diff --git a/toolchain/check/testdata/builtins/int/smod.carbon b/toolchain/check/testdata/builtins/int/smod.carbon index dbcd590aa401..bd15000b6a26 100644 --- a/toolchain/check/testdata/builtins/int/smod.carbon +++ b/toolchain/check/testdata/builtins/int/smod.carbon @@ -57,7 +57,8 @@ fn Mod(a: i32, b: i32) -> i32 = "int.smod"; // CHECK:STDERR: let a: i32 = Mod(1, 0); -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error: division by zero [CompileTimeDivisionByZero] +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error: division by zero [CompileTimeDivisionByZero] // CHECK:STDERR: let b: i32 = Mod(0, 0); // CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: let b: i32 = Mod(0, 0); diff --git a/toolchain/check/testdata/builtins/int/smul.carbon b/toolchain/check/testdata/builtins/int/smul.carbon index 403efe866b39..fb436a51f1d5 100644 --- a/toolchain/check/testdata/builtins/int/smul.carbon +++ b/toolchain/check/testdata/builtins/int/smul.carbon @@ -66,7 +66,8 @@ package FailOverflow; fn Mul(a: i32, b: i32) -> i32 = "int.smul"; let a: i32 = Mul(0x7FFF, 0x10000); -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error: integer overflow in calculation `32768 * 65536` [CompileTimeIntegerOverflow] +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:14: error: integer overflow in calculation `32768 * 65536` [CompileTimeIntegerOverflow] // CHECK:STDERR: let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: let b: i32 = Mul(0x8000, 0x10000); diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index 93b3d41d66a3..1c5a448f0263 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -128,7 +128,8 @@ fn Sub(a: i32, b: i32) -> i32 = "int.ssub"; let a: i32 = Negate(Negate(0x7FFF_FFFF)); // -INT_MIN is too large for i32. -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error: integer overflow in negation of -2147483648 [CompileTimeIntegerNegateOverflow] +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:14: error: integer overflow in negation of -2147483648 [CompileTimeIntegerNegateOverflow] // CHECK:STDERR: let b: i32 = Negate(-0x8000_0000); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: let b: i32 = Negate(-0x8000_0000); diff --git a/toolchain/check/testdata/builtins/int/ssub.carbon b/toolchain/check/testdata/builtins/int/ssub.carbon index a7cdfe90ca12..a52cad1d39f1 100644 --- a/toolchain/check/testdata/builtins/int/ssub.carbon +++ b/toolchain/check/testdata/builtins/int/ssub.carbon @@ -29,7 +29,8 @@ fn Sub(a: i32, b: i32) -> i32 = "int.ssub"; let a: i32 = Sub(0, 0x7FFFFFFF); let b: i32 = Sub(Sub(0, 0x7FFFFFFF), 1); -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error: integer overflow in calculation `-2147483647 - 2` [CompileTimeIntegerOverflow] +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:14: error: integer overflow in calculation `-2147483647 - 2` [CompileTimeIntegerOverflow] // CHECK:STDERR: let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index cd7ac70b6b99..064caa751627 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -58,12 +58,13 @@ var too_many: [i32; TooMany(1, 2, 3)]; // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1, 2)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:21: error: 3 arguments passed to function expecting 2 arguments [CallArgCountMismatch] +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: error: 3 arguments passed to function expecting 2 arguments [CallArgCountMismatch] // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2, 3)]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note: calling function declared here [InCallToEntity] // CHECK:STDERR: fn JustRight(a: i32, b: i32) -> i32 = "int.uadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: var bad_call: [i32; JustRight(1, 2, 3)]; fn RuntimeCallIsValidTooFew(a: i32) -> i32 { diff --git a/toolchain/check/testdata/builtins/int/udiv.carbon b/toolchain/check/testdata/builtins/int/udiv.carbon index 1efe7a893858..922034530650 100644 --- a/toolchain/check/testdata/builtins/int/udiv.carbon +++ b/toolchain/check/testdata/builtins/int/udiv.carbon @@ -50,7 +50,8 @@ fn Div(a: i32, b: i32) -> i32 = "int.udiv"; // CHECK:STDERR: let a: i32 = Div(1, 0); -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error: division by zero [CompileTimeDivisionByZero] +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error: division by zero [CompileTimeDivisionByZero] // CHECK:STDERR: let b: i32 = Div(0, 0); // CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: let b: i32 = Div(0, 0); diff --git a/toolchain/check/testdata/builtins/int/umod.carbon b/toolchain/check/testdata/builtins/int/umod.carbon index dc6067eb2d64..65498af8bea3 100644 --- a/toolchain/check/testdata/builtins/int/umod.carbon +++ b/toolchain/check/testdata/builtins/int/umod.carbon @@ -52,7 +52,8 @@ fn Mod(a: i32, b: i32) -> i32 = "int.umod"; // CHECK:STDERR: let a: i32 = Mod(1, 0); -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error: division by zero [CompileTimeDivisionByZero] +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error: division by zero [CompileTimeDivisionByZero] // CHECK:STDERR: let b: i32 = Mod(0, 0); // CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: let b: i32 = Mod(0, 0); diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index 0bbd88372f7d..39bdaf6f153c 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -92,12 +92,13 @@ fn RuntimeCallIsValidTooMany(a: u32, b: u32, c: u32) -> u32 { } fn RuntimeCallIsValidBadReturnType(a: u32, b: u32) -> bool { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:10: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch] + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch] // CHECK:STDERR: return BadReturnType(a, b); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: note: calling function declared here [InCallToEntity] // CHECK:STDERR: fn BadReturnType(a: u32) -> bool = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: return BadReturnType(a, b); } diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index 9262c203d7a0..556cc69c269d 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -128,12 +128,13 @@ class A { // CHECK:STDERR: ^ // CHECK:STDERR: let x: i32 = A.x; -// CHECK:STDERR: fail_global_access.carbon:[[@LINE+6]]:14: error: cannot access private member `y` of type `A` [ClassInvalidMemberAccess] +// CHECK:STDERR: fail_global_access.carbon:[[@LINE+7]]:14: error: cannot access private member `y` of type `A` [ClassInvalidMemberAccess] // CHECK:STDERR: let y: i32 = A.y; // CHECK:STDERR: ^~~ // CHECK:STDERR: fail_global_access.carbon:[[@LINE-14]]:15: note: declared here [ClassMemberDeclaration] // CHECK:STDERR: private let y: i32 = 5; // CHECK:STDERR: ^ +// CHECK:STDERR: let y: i32 = A.y; // --- self_access.carbon @@ -563,7 +564,7 @@ class A { // CHECK:STDOUT: %A.ref.loc16: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %x.ref: = name_ref x, [template = ] // CHECK:STDOUT: %x: %i32 = bind_name x, -// CHECK:STDOUT: %A.ref.loc23: type = name_ref A, file.%A.decl [template = constants.%A] +// CHECK:STDOUT: %A.ref.loc24: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %y.ref: = name_ref y, [template = ] // CHECK:STDOUT: %y: %i32 = bind_name y, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/adapter/adapt.carbon b/toolchain/check/testdata/class/adapter/adapt.carbon index a41cf449c9fb..1e3a2d9d368f 100644 --- a/toolchain/check/testdata/class/adapter/adapt.carbon +++ b/toolchain/check/testdata/class/adapter/adapt.carbon @@ -57,9 +57,10 @@ fn F() { } interface I { - // CHECK:STDERR: fail_misplaced.carbon:[[@LINE+3]]:3: error: `adapt` declaration outside class [ClassSpecificDeclOutsideClass] + // CHECK:STDERR: fail_misplaced.carbon:[[@LINE+4]]:3: error: `adapt` declaration outside class [ClassSpecificDeclOutsideClass] // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: adapt i32; } diff --git a/toolchain/check/testdata/class/adapter/adapt_copy.carbon b/toolchain/check/testdata/class/adapter/adapt_copy.carbon index 3e12949a7353..56dca0d13609 100644 --- a/toolchain/check/testdata/class/adapter/adapt_copy.carbon +++ b/toolchain/check/testdata/class/adapter/adapt_copy.carbon @@ -92,12 +92,13 @@ fn H(a: AdaptNoncopyableIndirect) -> AdaptNoncopyableIndirect { // CHECK:STDERR: ^ // CHECK:STDERR: var b: AdaptNoncopyableIndirect = a; - // CHECK:STDERR: fail_adapt_not_copyable_indirect.carbon:[[@LINE+6]]:3: error: cannot copy value of type `Noncopyable` [CopyOfUncopyableType] + // CHECK:STDERR: fail_adapt_not_copyable_indirect.carbon:[[@LINE+7]]:3: error: cannot copy value of type `Noncopyable` [CopyOfUncopyableType] // CHECK:STDERR: return b; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_adapt_not_copyable_indirect.carbon:[[@LINE+3]]:10: note: in copy of `AdaptNoncopyableIndirect` [InCopy] + // CHECK:STDERR: fail_adapt_not_copyable_indirect.carbon:[[@LINE+4]]:10: note: in copy of `AdaptNoncopyableIndirect` [InCopy] // CHECK:STDERR: return b; // CHECK:STDERR: ^ + // CHECK:STDERR: return b; } @@ -553,14 +554,14 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %tuple.elem1.loc20: %Noncopyable = tuple_access %.loc20_38.1, element1 // CHECK:STDOUT: assign %b.var, // CHECK:STDOUT: %b.ref: ref %AdaptNoncopyableIndirect = name_ref b, %b -// CHECK:STDOUT: %.loc27_11.1: ref %tuple.type.c9a = as_compatible %b.ref -// CHECK:STDOUT: %tuple.elem0.loc27_11.1: ref %i32 = tuple_access %.loc27_11.1, element0 -// CHECK:STDOUT: %.loc27_11.2: %i32 = bind_value %tuple.elem0.loc27_11.1 -// CHECK:STDOUT: %.loc27_11.3: ref %tuple.type.c9a = as_compatible %return -// CHECK:STDOUT: %tuple.elem0.loc27_11.2: ref %i32 = tuple_access %.loc27_11.3, element0 -// CHECK:STDOUT: %.loc27_11.4: init %i32 = initialize_from %.loc27_11.2 to %tuple.elem0.loc27_11.2 -// CHECK:STDOUT: %tuple.elem1.loc27: ref %Noncopyable = tuple_access %.loc27_11.1, element1 -// CHECK:STDOUT: %.loc27_11.5: %Noncopyable = bind_value %tuple.elem1.loc27 +// CHECK:STDOUT: %.loc28_11.1: ref %tuple.type.c9a = as_compatible %b.ref +// CHECK:STDOUT: %tuple.elem0.loc28_11.1: ref %i32 = tuple_access %.loc28_11.1, element0 +// CHECK:STDOUT: %.loc28_11.2: %i32 = bind_value %tuple.elem0.loc28_11.1 +// CHECK:STDOUT: %.loc28_11.3: ref %tuple.type.c9a = as_compatible %return +// CHECK:STDOUT: %tuple.elem0.loc28_11.2: ref %i32 = tuple_access %.loc28_11.3, element0 +// CHECK:STDOUT: %.loc28_11.4: init %i32 = initialize_from %.loc28_11.2 to %tuple.elem0.loc28_11.2 +// CHECK:STDOUT: %tuple.elem1.loc28: ref %Noncopyable = tuple_access %.loc28_11.1, element1 +// CHECK:STDOUT: %.loc28_11.5: %Noncopyable = bind_value %tuple.elem1.loc28 // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/adapter/extend_adapt.carbon b/toolchain/check/testdata/class/adapter/extend_adapt.carbon index fd07bc9fbf4a..9c16184fe40d 100644 --- a/toolchain/check/testdata/class/adapter/extend_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/extend_adapt.carbon @@ -131,9 +131,10 @@ class IntAdapter { fn F(a: IntAdapter) -> i32 { // Builtin types have no member names. - // CHECK:STDERR: fail_adapt_builtin.carbon:[[@LINE+3]]:10: error: member name `foo` not found in `IntAdapter` [MemberNameNotFoundInScope] + // CHECK:STDERR: fail_adapt_builtin.carbon:[[@LINE+4]]:10: error: member name `foo` not found in `IntAdapter` [MemberNameNotFoundInScope] // CHECK:STDERR: return a.foo; // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: return a.foo; } diff --git a/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon index a2c842ecb9b6..7509ed5e8131 100644 --- a/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/adapter/fail_adapt_bad_decl.carbon @@ -95,9 +95,10 @@ interface I { class C { interface I { - // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+3]]:5: error: `adapt` declaration outside class [ClassSpecificDeclOutsideClass] + // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+4]]:5: error: `adapt` declaration outside class [ClassSpecificDeclOutsideClass] // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: adapt {}; } } @@ -290,7 +291,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: interface @I.2 { // CHECK:STDOUT: %Self: %I.type.e30 = bind_symbolic_name Self, 0 [symbolic = constants.%Self.6ef] -// CHECK:STDOUT: %.loc23: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc24: %empty_struct_type = struct_literal () // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self diff --git a/toolchain/check/testdata/class/adapter/fail_adapt_bad_type.carbon b/toolchain/check/testdata/class/adapter/fail_adapt_bad_type.carbon index ebef84227ef3..f9cf1987285f 100644 --- a/toolchain/check/testdata/class/adapter/fail_adapt_bad_type.carbon +++ b/toolchain/check/testdata/class/adapter/fail_adapt_bad_type.carbon @@ -15,12 +15,13 @@ library "[[@TEST_NAME]]"; class Incomplete; class AdaptIncomplete { - // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+6]]:3: error: adapted type `Incomplete` is an incomplete type [IncompleteTypeInAdaptDecl] + // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+7]]:3: error: adapted type `Incomplete` is an incomplete type [IncompleteTypeInAdaptDecl] // CHECK:STDERR: adapt Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE-6]]:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ + // CHECK:STDERR: adapt Incomplete; } diff --git a/toolchain/check/testdata/class/adapter/fail_adapt_modifiers.carbon b/toolchain/check/testdata/class/adapter/fail_adapt_modifiers.carbon index 1bbea007eb1b..95249c47e766 100644 --- a/toolchain/check/testdata/class/adapter/fail_adapt_modifiers.carbon +++ b/toolchain/check/testdata/class/adapter/fail_adapt_modifiers.carbon @@ -46,12 +46,13 @@ class C4 { } class C5 { - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+6]]:10: error: `base` not allowed on declaration with `extend` [ModifierNotAllowedWith] + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+7]]:10: error: `base` not allowed on declaration with `extend` [ModifierNotAllowedWith] // CHECK:STDERR: extend base adapt B; // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+3]]:3: note: `extend` previously appeared here [ModifierPrevious] + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: note: `extend` previously appeared here [ModifierPrevious] // CHECK:STDERR: extend base adapt B; // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: extend base adapt B; } diff --git a/toolchain/check/testdata/class/adapter/fail_adapt_with_base.carbon b/toolchain/check/testdata/class/adapter/fail_adapt_with_base.carbon index 93cba32d799e..b23599769480 100644 --- a/toolchain/check/testdata/class/adapter/fail_adapt_with_base.carbon +++ b/toolchain/check/testdata/class/adapter/fail_adapt_with_base.carbon @@ -10,12 +10,13 @@ class Simple {}; base class AdaptWithVirtual { virtual fn F(); - // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+6]]:3: error: adapter with virtual function [AdaptWithVirtual] + // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+7]]:3: error: adapter with virtual function [AdaptWithVirtual] // CHECK:STDERR: adapt Simple; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE-4]]:3: note: first virtual function declaration is here [AdaptWithVirtualHere] // CHECK:STDERR: virtual fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: adapt Simple; } diff --git a/toolchain/check/testdata/class/adapter/fail_adapt_with_subobjects.carbon b/toolchain/check/testdata/class/adapter/fail_adapt_with_subobjects.carbon index a4ce0134f490..06d5edc415a5 100644 --- a/toolchain/check/testdata/class/adapter/fail_adapt_with_subobjects.carbon +++ b/toolchain/check/testdata/class/adapter/fail_adapt_with_subobjects.carbon @@ -65,12 +65,13 @@ base class Base {} class AdaptWithBaseAndFields { extend base: Base; var n: i32; - // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE+6]]:3: error: adapter with base class [AdaptWithBase] + // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE+7]]:3: error: adapter with base class [AdaptWithBase] // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE-5]]:3: note: `base` declaration is here [AdaptWithBaseHere] // CHECK:STDERR: extend base: Base; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: adapt {}; } @@ -208,9 +209,9 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc7: %AdaptWithBaseAndFields.elem.767 = base_decl %Base.ref, element [template] // CHECK:STDOUT: %.loc8: %AdaptWithBaseAndFields.elem.ddf = field_decl n, element [template] -// CHECK:STDOUT: %.loc15_10: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc15_11: type = converted %.loc15_10, constants.%empty_struct_type [template = constants.%empty_struct_type] -// CHECK:STDOUT: adapt_decl %.loc15_11 [template] +// CHECK:STDOUT: %.loc16_10: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc16_11: type = converted %.loc16_10, constants.%empty_struct_type [template = constants.%empty_struct_type] +// CHECK:STDOUT: adapt_decl %.loc16_11 [template] // CHECK:STDOUT: complete_type_witness = // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/adapter/init_adapt.carbon b/toolchain/check/testdata/class/adapter/init_adapt.carbon index b124a77ecb9e..4d8dca3e220d 100644 --- a/toolchain/check/testdata/class/adapter/init_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/init_adapt.carbon @@ -83,12 +83,13 @@ fn MakeAdaptC() -> AdaptC; // CHECK:STDERR: var d: AdaptC = MakeC(); -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `AdaptC` to `C` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `AdaptC` to `C` [ImplicitAsConversionFailure] // CHECK:STDERR: var e: C = MakeAdaptC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+3]]:1: note: type `AdaptC` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `AdaptC` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var e: C = MakeAdaptC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: var e: C = MakeAdaptC(); // CHECK:STDOUT: --- init_adapt.carbon @@ -370,9 +371,9 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc46_24: %AdaptC = converted %MakeC.call, [template = ] // CHECK:STDOUT: assign file.%d.var, // CHECK:STDOUT: %MakeAdaptC.ref: %MakeAdaptC.type = name_ref MakeAdaptC, file.%MakeAdaptC.decl [template = constants.%MakeAdaptC] -// CHECK:STDOUT: %.loc54_23: ref %AdaptC = temporary_storage -// CHECK:STDOUT: %MakeAdaptC.call: init %AdaptC = call %MakeAdaptC.ref() to %.loc54_23 -// CHECK:STDOUT: %.loc54_24: %C = converted %MakeAdaptC.call, [template = ] +// CHECK:STDOUT: %.loc55_23: ref %AdaptC = temporary_storage +// CHECK:STDOUT: %MakeAdaptC.call: init %AdaptC = call %MakeAdaptC.ref() to %.loc55_23 +// CHECK:STDOUT: %.loc55_24: %C = converted %MakeAdaptC.call, [template = ] // CHECK:STDOUT: assign file.%e.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index 3caebc0e8cd0..5abff4b389d3 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -38,9 +38,10 @@ base class Base { class Derived { var d: i32; - // CHECK:STDERR: fail_base_after_field.carbon:[[@LINE+3]]:3: error: `base` declaration must appear before field declarations [BaseDeclAfterFieldDecl] + // CHECK:STDERR: fail_base_after_field.carbon:[[@LINE+4]]:3: error: `base` declaration must appear before field declarations [BaseDeclAfterFieldDecl] // CHECK:STDERR: extend base: Base; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: extend base: Base; } diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index 4374eca8ceac..6dcef1f2b8d6 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -94,9 +94,10 @@ library "[[@TEST_NAME]]"; import Other library "other_define"; import Other library "other_conflict"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:8: note: in name lookup for `C` [InNameLookup] +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:8: note: in name lookup for `C` [InNameLookup] // CHECK:STDERR: var c: Other.C = {}; // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: var c: Other.C = {}; // CHECK:STDOUT: --- other_define.carbon @@ -351,10 +352,10 @@ var c: Other.C = {}; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc18_19.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc18_19.2: init %C = class_init (), file.%c.var [template = constants.%C.val] -// CHECK:STDOUT: %.loc18_20: init %C = converted %.loc18_19.1, %.loc18_19.2 [template = constants.%C.val] -// CHECK:STDOUT: assign file.%c.var, %.loc18_20 +// CHECK:STDOUT: %.loc19_19.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc19_19.2: init %C = class_init (), file.%c.var [template = constants.%C.val] +// CHECK:STDOUT: %.loc19_20: init %C = converted %.loc19_19.1, %.loc19_19.2 [template = constants.%C.val] +// CHECK:STDOUT: assign file.%c.var, %.loc19_20 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index e3ed943960cc..81fa095f5006 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -176,7 +176,7 @@ abstract class Abstract { fn ReturnAbstract() -> Abstract; fn CallReturnAbstract() { - // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE+9]]:3: error: function returns abstract type `Abstract` [AbstractTypeInFunctionReturnType] + // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE+10]]:3: error: function returns abstract type `Abstract` [AbstractTypeInFunctionReturnType] // CHECK:STDERR: ReturnAbstract(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE-9]]:1: note: class was declared abstract here [ClassAbstractHere] @@ -185,6 +185,7 @@ fn CallReturnAbstract() { // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE-9]]:21: note: return type declared here [IncompleteReturnTypeHere] // CHECK:STDERR: fn ReturnAbstract() -> Abstract; // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: ReturnAbstract(); } diff --git a/toolchain/check/testdata/class/fail_addr_not_self.carbon b/toolchain/check/testdata/class/fail_addr_not_self.carbon index 085c34d6918d..d2e0e6542428 100644 --- a/toolchain/check/testdata/class/fail_addr_not_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_not_self.carbon @@ -15,9 +15,10 @@ class Class { // CHECK:STDERR: fn F[addr a:! Class*](); - // CHECK:STDERR: fail_addr_not_self.carbon:[[@LINE+3]]:8: error: `addr` can only be applied to a `self` parameter [AddrOnNonSelfParam] + // CHECK:STDERR: fail_addr_not_self.carbon:[[@LINE+4]]:8: error: `addr` can only be applied to a `self` parameter [AddrOnNonSelfParam] // CHECK:STDERR: fn G(addr b: Class*); // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fn G(addr b: Class*); } @@ -69,7 +70,7 @@ class Class { // CHECK:STDOUT: %b.param_patt: %ptr = value_param_pattern %b.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %b.param: %ptr = value_param runtime_param0 -// CHECK:STDOUT: %.loc21: type = splice_block %ptr [template = constants.%ptr] { +// CHECK:STDOUT: %.loc22: type = splice_block %ptr [template = constants.%ptr] { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %ptr: type = ptr_type %Class [template = constants.%ptr] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_addr_self.carbon b/toolchain/check/testdata/class/fail_addr_self.carbon index f2e8004fe2d4..961da001c456 100644 --- a/toolchain/check/testdata/class/fail_addr_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_self.carbon @@ -18,12 +18,13 @@ class Class { } fn F(c: Class, p: Class*) { - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+6]]:3: error: `addr self` method cannot be invoked on a value [AddrSelfIsNonRef] + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+7]]:3: error: `addr self` method cannot be invoked on a value [AddrSelfIsNonRef] // CHECK:STDERR: c.F(); // CHECK:STDERR: ^ // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-12]]:8: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: fn F[addr self: Class*](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ + // CHECK:STDERR: c.F(); c.G(); @@ -114,26 +115,26 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2(%c.param_patt: %Class, %p.param_patt: %ptr.e71) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %c.ref.loc27: %Class = name_ref c, %c -// CHECK:STDOUT: %F.ref.loc27: %F.type.f1b = name_ref F, @Class.%F.decl [template = constants.%F.1f2] -// CHECK:STDOUT: %F.bound.loc27: = bound_method %c.ref.loc27, %F.ref.loc27 -// CHECK:STDOUT: %F.call.loc27: init %empty_tuple.type = call %F.bound.loc27() -// CHECK:STDOUT: %c.ref.loc29: %Class = name_ref c, %c -// CHECK:STDOUT: %G.ref.loc29: %G.type = name_ref G, @Class.%G.decl [template = constants.%G] -// CHECK:STDOUT: %G.bound.loc29: = bound_method %c.ref.loc29, %G.ref.loc29 -// CHECK:STDOUT: %G.call.loc29: init %empty_tuple.type = call %G.bound.loc29(%c.ref.loc29) -// CHECK:STDOUT: %p.ref.loc32: %ptr.e71 = name_ref p, %p -// CHECK:STDOUT: %.loc32: ref %Class = deref %p.ref.loc32 -// CHECK:STDOUT: %F.ref.loc32: %F.type.f1b = name_ref F, @Class.%F.decl [template = constants.%F.1f2] -// CHECK:STDOUT: %F.bound.loc32: = bound_method %.loc32, %F.ref.loc32 -// CHECK:STDOUT: %addr: %ptr.e71 = addr_of %.loc32 -// CHECK:STDOUT: %F.call.loc32: init %empty_tuple.type = call %F.bound.loc32(%addr) -// CHECK:STDOUT: %p.ref.loc34: %ptr.e71 = name_ref p, %p -// CHECK:STDOUT: %.loc34_4.1: ref %Class = deref %p.ref.loc34 -// CHECK:STDOUT: %G.ref.loc34: %G.type = name_ref G, @Class.%G.decl [template = constants.%G] -// CHECK:STDOUT: %G.bound.loc34: = bound_method %.loc34_4.1, %G.ref.loc34 -// CHECK:STDOUT: %.loc34_4.2: %Class = bind_value %.loc34_4.1 -// CHECK:STDOUT: %G.call.loc34: init %empty_tuple.type = call %G.bound.loc34(%.loc34_4.2) +// CHECK:STDOUT: %c.ref.loc28: %Class = name_ref c, %c +// CHECK:STDOUT: %F.ref.loc28: %F.type.f1b = name_ref F, @Class.%F.decl [template = constants.%F.1f2] +// CHECK:STDOUT: %F.bound.loc28: = bound_method %c.ref.loc28, %F.ref.loc28 +// CHECK:STDOUT: %F.call.loc28: init %empty_tuple.type = call %F.bound.loc28() +// CHECK:STDOUT: %c.ref.loc30: %Class = name_ref c, %c +// CHECK:STDOUT: %G.ref.loc30: %G.type = name_ref G, @Class.%G.decl [template = constants.%G] +// CHECK:STDOUT: %G.bound.loc30: = bound_method %c.ref.loc30, %G.ref.loc30 +// CHECK:STDOUT: %G.call.loc30: init %empty_tuple.type = call %G.bound.loc30(%c.ref.loc30) +// CHECK:STDOUT: %p.ref.loc33: %ptr.e71 = name_ref p, %p +// CHECK:STDOUT: %.loc33: ref %Class = deref %p.ref.loc33 +// CHECK:STDOUT: %F.ref.loc33: %F.type.f1b = name_ref F, @Class.%F.decl [template = constants.%F.1f2] +// CHECK:STDOUT: %F.bound.loc33: = bound_method %.loc33, %F.ref.loc33 +// CHECK:STDOUT: %addr: %ptr.e71 = addr_of %.loc33 +// CHECK:STDOUT: %F.call.loc33: init %empty_tuple.type = call %F.bound.loc33(%addr) +// CHECK:STDOUT: %p.ref.loc35: %ptr.e71 = name_ref p, %p +// CHECK:STDOUT: %.loc35_4.1: ref %Class = deref %p.ref.loc35 +// CHECK:STDOUT: %G.ref.loc35: %G.type = name_ref G, @Class.%G.decl [template = constants.%G] +// CHECK:STDOUT: %G.bound.loc35: = bound_method %.loc35_4.1, %G.ref.loc35 +// CHECK:STDOUT: %.loc35_4.2: %Class = bind_value %.loc35_4.1 +// CHECK:STDOUT: %G.call.loc35: init %empty_tuple.type = call %G.bound.loc35(%.loc35_4.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_base_as_declared_name.carbon b/toolchain/check/testdata/class/fail_base_as_declared_name.carbon index 59dc0914996c..defd44bc36f4 100644 --- a/toolchain/check/testdata/class/fail_base_as_declared_name.carbon +++ b/toolchain/check/testdata/class/fail_base_as_declared_name.carbon @@ -10,13 +10,14 @@ namespace N; -// CHECK:STDERR: fail_base_as_declared_name.carbon:[[@LINE+7]]:6: error: `.` should be followed by a name [ExpectedDeclNameAfterPeriod] +// CHECK:STDERR: fail_base_as_declared_name.carbon:[[@LINE+8]]:6: error: `.` should be followed by a name [ExpectedDeclNameAfterPeriod] // CHECK:STDERR: fn N.base() {} // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_base_as_declared_name.carbon:[[@LINE+3]]:6: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] +// CHECK:STDERR: fail_base_as_declared_name.carbon:[[@LINE+4]]:6: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] // CHECK:STDERR: fn N.base() {} // CHECK:STDERR: ^~~~ +// CHECK:STDERR: fn N.base() {} // CHECK:STDOUT: --- fail_base_as_declared_name.carbon diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index 2694236f36fe..2d768ab66ca5 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -171,9 +171,10 @@ fn AccessMemberWithInvalidBaseFinal_WithMember(p: DeriveFromFinal*) -> i32 { } fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { - // CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+3]]:10: error: member name `b` not found in `DeriveFromFinal` [MemberNameNotFoundInScope] + // CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+4]]:10: error: member name `b` not found in `DeriveFromFinal` [MemberNameNotFoundInScope] // CHECK:STDERR: return (*p).b; // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: return (*p).b; } @@ -832,7 +833,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_NoMember(%p.param_patt: %ptr.160) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.160 = name_ref p, %p -// CHECK:STDOUT: %.loc29: ref %DeriveFromFinal = deref %p.ref +// CHECK:STDOUT: %.loc30: ref %DeriveFromFinal = deref %p.ref // CHECK:STDOUT: %b.ref: = name_ref b, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_base_method_define.carbon b/toolchain/check/testdata/class/fail_base_method_define.carbon index 934be98deafb..b5e99ce5f535 100644 --- a/toolchain/check/testdata/class/fail_base_method_define.carbon +++ b/toolchain/check/testdata/class/fail_base_method_define.carbon @@ -26,9 +26,10 @@ class D { // CHECK:STDERR: fn D.F() {} -// CHECK:STDERR: fail_base_method_define.carbon:[[@LINE+3]]:6: error: name `C` not found [NameNotFound] +// CHECK:STDERR: fail_base_method_define.carbon:[[@LINE+4]]:6: error: name `C` not found [NameNotFound] // CHECK:STDERR: fn D.C.F() {} // CHECK:STDERR: ^ +// CHECK:STDERR: fn D.C.F() {} // CHECK:STDOUT: --- fail_base_method_define.carbon diff --git a/toolchain/check/testdata/class/fail_base_misplaced.carbon b/toolchain/check/testdata/class/fail_base_misplaced.carbon index b8af0720c8d9..ece0ddd9258d 100644 --- a/toolchain/check/testdata/class/fail_base_misplaced.carbon +++ b/toolchain/check/testdata/class/fail_base_misplaced.carbon @@ -26,9 +26,10 @@ fn F() { class C { fn F() { - // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+3]]:5: error: `base` declaration outside class [ClassSpecificDeclOutsideClass] + // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+4]]:5: error: `base` declaration outside class [ClassSpecificDeclOutsideClass] // CHECK:STDERR: extend base: B; // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: extend base: B; } } diff --git a/toolchain/check/testdata/class/fail_base_modifiers.carbon b/toolchain/check/testdata/class/fail_base_modifiers.carbon index 6a1ea9f272b2..fbefcaa34734 100644 --- a/toolchain/check/testdata/class/fail_base_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_base_modifiers.carbon @@ -42,12 +42,13 @@ class C3 { } class C4 { - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+6]]:10: error: `extend` repeated on declaration [ModifierRepeated] + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+7]]:10: error: `extend` repeated on declaration [ModifierRepeated] // CHECK:STDERR: extend extend base: B; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+3]]:3: note: `extend` previously appeared here [ModifierPrevious] + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: note: `extend` previously appeared here [ModifierPrevious] // CHECK:STDERR: extend extend base: B; // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: extend extend base: B; } @@ -121,7 +122,7 @@ class C4 { // CHECK:STDOUT: // CHECK:STDOUT: class @C4 { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc51: %C4.elem = base_decl %B.ref, element0 [template] +// CHECK:STDOUT: %.loc52: %C4.elem = base_decl %B.ref, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base [template = constants.%complete_type.98e] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_base_no_extend.carbon b/toolchain/check/testdata/class/fail_base_no_extend.carbon index 20099c79b1f5..0e37dddaeac5 100644 --- a/toolchain/check/testdata/class/fail_base_no_extend.carbon +++ b/toolchain/check/testdata/class/fail_base_no_extend.carbon @@ -11,9 +11,10 @@ base class B {} class C { - // CHECK:STDERR: fail_base_no_extend.carbon:[[@LINE+3]]:3: error: missing `extend` before `base` declaration [BaseMissingExtend] + // CHECK:STDERR: fail_base_no_extend.carbon:[[@LINE+4]]:3: error: missing `extend` before `base` declaration [BaseMissingExtend] // CHECK:STDERR: base: B; // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: base: B; } @@ -54,7 +55,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc17: %C.elem = base_decl %B.ref, element0 [template] +// CHECK:STDOUT: %.loc18: %C.elem = base_decl %B.ref, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base [template = constants.%complete_type.98e] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_base_repeated.carbon b/toolchain/check/testdata/class/fail_base_repeated.carbon index 5b0c5a09aff9..01082b1cef26 100644 --- a/toolchain/check/testdata/class/fail_base_repeated.carbon +++ b/toolchain/check/testdata/class/fail_base_repeated.carbon @@ -26,12 +26,13 @@ class C { class D { // TODO: Consider adding a custom diagnostic for this case. extend base: B1; - // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+6]]:3: error: multiple `base` declarations in class; multiple inheritance is not permitted [BaseDeclRepeated] + // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+7]]:3: error: multiple `base` declarations in class; multiple inheritance is not permitted [BaseDeclRepeated] // CHECK:STDERR: extend base: B1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: note: previous `base` declaration is here [ClassSpecificDeclPrevious] // CHECK:STDERR: extend base: B1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ + // CHECK:STDERR: extend base: B1; } @@ -93,7 +94,7 @@ class D { // CHECK:STDOUT: class @D { // CHECK:STDOUT: %B1.ref.loc28: type = name_ref B1, file.%B1.decl [template = constants.%B1] // CHECK:STDOUT: %.loc28: %D.elem = base_decl %B1.ref.loc28, element0 [template] -// CHECK:STDOUT: %B1.ref.loc35: type = name_ref B1, file.%B1.decl [template = constants.%B1] +// CHECK:STDOUT: %B1.ref.loc36: type = name_ref B1, file.%B1.decl [template = constants.%B1] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.base [template = constants.%complete_type.5ac] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_base_unbound.carbon b/toolchain/check/testdata/class/fail_base_unbound.carbon index c4aa0ac89a57..5c714270d034 100644 --- a/toolchain/check/testdata/class/fail_base_unbound.carbon +++ b/toolchain/check/testdata/class/fail_base_unbound.carbon @@ -14,9 +14,10 @@ class C { extend base: B; } -// CHECK:STDERR: fail_base_unbound.carbon:[[@LINE+3]]:12: error: expression cannot be used as a value [UseOfNonExprAsValue] +// CHECK:STDERR: fail_base_unbound.carbon:[[@LINE+4]]:12: error: expression cannot be used as a value [UseOfNonExprAsValue] // CHECK:STDERR: let b: B = C.base; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: let b: B = C.base; // CHECK:STDOUT: --- fail_base_unbound.carbon diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index 94beaf8a5389..453fc7ce4fe5 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -17,12 +17,13 @@ class B { } fn AccessBInA(a: A) -> i32 { - // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+6]]:10: error: cannot implicitly convert from `A` to `B` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+7]]:10: error: cannot implicitly convert from `A` to `B` [ImplicitAsConversionFailure] // CHECK:STDERR: return a.(B.b); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+3]]:10: note: type `A` does not implement interface `Core.ImplicitAs(B)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+4]]:10: note: type `A` does not implement interface `Core.ImplicitAs(B)` [MissingImplInMemberAccessNote] // CHECK:STDERR: return a.(B.b); // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: return a.(B.b); } @@ -95,8 +96,8 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %b.ref: %B.elem = name_ref b, @B.%.loc16 [template = @B.%.loc16] -// CHECK:STDOUT: %.loc26_11.1: %B = converted %a.ref, [template = ] -// CHECK:STDOUT: %.loc26_11.2: %i32 = class_element_access , element0 [template = ] +// CHECK:STDOUT: %.loc27_11.1: %B = converted %a.ref, [template = ] +// CHECK:STDOUT: %.loc27_11.2: %i32 = class_element_access , element0 [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon index 1dfafb29e442..c3c8b763ff43 100644 --- a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon +++ b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_convert_to_invalid.carbon class C { - // CHECK:STDERR: fail_convert_to_invalid.carbon:[[@LINE+3]]:10: error: name `NoSuchType` not found [NameNotFound] + // CHECK:STDERR: fail_convert_to_invalid.carbon:[[@LINE+4]]:10: error: name `NoSuchType` not found [NameNotFound] // CHECK:STDERR: var a: NoSuchType; // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: var a: NoSuchType; } @@ -55,7 +56,7 @@ fn Make() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc15: = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc16: = field_decl a, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness [template = ] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -63,7 +64,7 @@ fn Make() -> C { // CHECK:STDOUT: fn @Make() -> %return.param_patt: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [template = constants.%int_123] -// CHECK:STDOUT: %.loc19: %struct_type.a = struct_literal (%int_123) +// CHECK:STDOUT: %.loc20: %struct_type.a = struct_literal (%int_123) // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index 07f6f0db36dd..dfb9ccd9c9f7 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -32,12 +32,13 @@ fn ConvertUnrelated(p: B2*) -> A1* { return p; } class Incomplete; -// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+6]]:47: error: cannot implicitly convert from `Incomplete*` to `A2*` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+7]]:47: error: cannot implicitly convert from `Incomplete*` to `A2*` [ImplicitAsConversionFailure] // CHECK:STDERR: fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+3]]:47: note: type `Incomplete*` does not implement interface `Core.ImplicitAs(A2*)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+4]]:47: note: type `Incomplete*` does not implement interface `Core.ImplicitAs(A2*)` [MissingImplInMemberAccessNote] // CHECK:STDERR: fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: --- fail_derived_to_base.carbon @@ -115,11 +116,11 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %return.param_patt: %ptr.590 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %A2.ref: type = name_ref A2, file.%A2.decl [template = constants.%A2] -// CHECK:STDOUT: %ptr.loc41_43: type = ptr_type %A2 [template = constants.%ptr.590] +// CHECK:STDOUT: %ptr.loc42_43: type = ptr_type %A2 [template = constants.%ptr.590] // CHECK:STDOUT: %p.param: %ptr.c62 = value_param runtime_param0 -// CHECK:STDOUT: %.loc41_35: type = splice_block %ptr.loc41_35 [template = constants.%ptr.c62] { +// CHECK:STDOUT: %.loc42_35: type = splice_block %ptr.loc42_35 [template = constants.%ptr.c62] { // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, file.%Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %ptr.loc41_35: type = ptr_type %Incomplete [template = constants.%ptr.c62] +// CHECK:STDOUT: %ptr.loc42_35: type = ptr_type %Incomplete [template = constants.%ptr.c62] // CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.c62 = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.590 = out_param runtime_param1 @@ -159,7 +160,7 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: fn @ConvertIncomplete(%p.param_patt: %ptr.c62) -> %ptr.590 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.c62 = name_ref p, %p -// CHECK:STDOUT: %.loc41_55: %ptr.590 = converted %p.ref, [template = ] +// CHECK:STDOUT: %.loc42_55: %ptr.590 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_extend_cycle.carbon b/toolchain/check/testdata/class/fail_extend_cycle.carbon index 9d0db33004f6..1c2091fd97eb 100644 --- a/toolchain/check/testdata/class/fail_extend_cycle.carbon +++ b/toolchain/check/testdata/class/fail_extend_cycle.carbon @@ -25,9 +25,10 @@ base class B { // CHECK:STDERR: base class A { extend base: A; - // CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE+3]]:10: error: name `C` not found [NameNotFound] + // CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE+4]]:10: error: name `C` not found [NameNotFound] // CHECK:STDERR: var c: C; // CHECK:STDERR: ^ + // CHECK:STDERR: var c: C; } @@ -79,7 +80,7 @@ base class A { // CHECK:STDOUT: class @.1 { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc27: %.elem = base_decl %A.ref, element0 [template] -// CHECK:STDOUT: %.loc31: = field_decl c, element1 [template] +// CHECK:STDOUT: %.loc32: = field_decl c, element1 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness [template = ] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index 893883d3a0ac..fc174d10cfda 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -28,9 +28,10 @@ class Class { // CHECK:STDERR: default let l: i32 = 0; - // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+3]]:3: error: `final` not allowed; requires interface scope [ModifierRequiresInterface] + // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+4]]:3: error: `final` not allowed; requires interface scope [ModifierRequiresInterface] // CHECK:STDERR: final let m: i32 = 1; // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: final let m: i32 = 1; } @@ -87,13 +88,13 @@ class Class { // CHECK:STDOUT: %.loc29_25.2: %i32 = converted %int_0, %.loc29_25.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %l: %i32 = bind_name l, %.loc29_25.2 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc34: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc34: = bound_method %int_1, %impl.elem0.loc34 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc34: = specific_function %Convert.bound.loc34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc34: init %i32 = call %Convert.specific_fn.loc34(%int_1) [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc34_23.1: %i32 = value_of_initializer %int.convert_checked.loc34 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc34_23.2: %i32 = converted %int_1, %.loc34_23.1 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %m: %i32 = bind_name m, %.loc34_23.2 +// CHECK:STDOUT: %impl.elem0.loc35: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc35: = bound_method %int_1, %impl.elem0.loc35 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %Convert.specific_fn.loc35: = specific_function %Convert.bound.loc35, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc35: init %i32 = call %Convert.specific_fn.loc35(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc35_23.1: %i32 = value_of_initializer %int.convert_checked.loc35 [template = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc35_23.2: %i32 = converted %int_1, %.loc35_23.1 [template = constants.%int_1.5d2] +// CHECK:STDOUT: %m: %i32 = bind_name m, %.loc35_23.2 // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.j.k [template = constants.%complete_type.cf7] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index 56f0b659a5be..fcdfbe2f5404 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -15,20 +15,21 @@ class Class(T:! type) { // TODO: The follow-on errors here aren't great. Investigate whether we can // enter the scope anyway if the parameters don't match. -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+14]]:10: error: type `i32` of parameter 1 in redeclaration differs from previous parameter type `type` [RedeclParamDiffersType] +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+15]]:10: error: type `i32` of parameter 1 in redeclaration differs from previous parameter type `type` [RedeclParamDiffersType] // CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_generic_method.carbon:[[@LINE-10]]:13: note: previous declaration's corresponding parameter here [RedeclParamPrevious] // CHECK:STDERR: class Class(T:! type) { // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+7]]:27: error: name `Self` not found [NameNotFound] +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+8]]:27: error: name `Self` not found [NameNotFound] // CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+3]]:36: error: name `T` not found [NameNotFound] +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+4]]:36: error: name `T` not found [NameNotFound] // CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDERR: ^ +// CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: --- fail_generic_method.carbon @@ -81,11 +82,11 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %n.param_patt: = value_param_pattern %n.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %N.param: %i32 = value_param runtime_param -// CHECK:STDOUT: %.loc32: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %.loc33: type = splice_block %i32 [template = constants.%i32] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc32_10.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc32_10.2 (constants.%N.51e)] +// CHECK:STDOUT: %N.loc33_10.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc33_10.2 (constants.%N.51e)] // CHECK:STDOUT: %self.param: = value_param runtime_param0 // CHECK:STDOUT: %Self.ref: = name_ref Self, [template = ] // CHECK:STDOUT: %self: = bind_name self, %self.param @@ -138,8 +139,8 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: fn[%self.param_patt: @F.%Class (%Class)](%n.param_patt: @F.%T (%T)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @.1(%N.loc32_10.1: %i32) { -// CHECK:STDOUT: %N.loc32_10.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc32_10.2 (constants.%N.51e)] +// CHECK:STDOUT: generic fn @.1(%N.loc33_10.1: %i32) { +// CHECK:STDOUT: %N.loc33_10.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc33_10.2 (constants.%N.51e)] // CHECK:STDOUT: %N.patt: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.8e2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -165,7 +166,7 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: specific @Class(%T.loc11_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%N.51e) { -// CHECK:STDOUT: %N.loc32_10.2 => constants.%N.51e +// CHECK:STDOUT: %N.loc33_10.2 => constants.%N.51e // CHECK:STDOUT: %N.patt => constants.%N.51e // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index 7f230b4e4236..5df8a33ad997 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -34,13 +34,14 @@ import library "a"; class Empty { } -// CHECK:STDERR: fail_b.carbon:[[@LINE+7]]:8: error: variable has incomplete type `Incomplete` [IncompleteTypeInVarDecl] +// CHECK:STDERR: fail_b.carbon:[[@LINE+8]]:8: error: variable has incomplete type `Incomplete` [IncompleteTypeInVarDecl] // CHECK:STDERR: var a: Incomplete; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fail_b.carbon:[[@LINE-16]]:1: in import [InImport] // CHECK:STDERR: a.carbon:7:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ +// CHECK:STDERR: var a: Incomplete; // CHECK:STDOUT: --- a.carbon diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index 746717d32eb1..7adfa1de309f 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -164,12 +164,13 @@ fn CallIncompleteAddrSelf(p: Class*) { library "[[@TEST_NAME]]"; class C { - // CHECK:STDERR: fail_in_definition.carbon:[[@LINE+6]]:10: error: field has incomplete type `C` [IncompleteTypeInVarDecl] + // CHECK:STDERR: fail_in_definition.carbon:[[@LINE+7]]:10: error: field has incomplete type `C` [IncompleteTypeInVarDecl] // CHECK:STDERR: var c: C; // CHECK:STDERR: ^ // CHECK:STDERR: fail_in_definition.carbon:[[@LINE-4]]:1: note: class is incomplete within its definition [ClassIncompleteWithinDefinition] // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: var c: C; } @@ -481,7 +482,7 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc11: = field_decl c, element0 [template] +// CHECK:STDOUT: %.loc12: = field_decl c, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness [template = ] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index 7c30c7c8445b..41c788be0a3c 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -24,9 +24,10 @@ fn F() { // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: {.a = 1, .c = 2} as Class; - // CHECK:STDERR: fail_init.carbon:[[@LINE+3]]:3: error: cannot initialize class with 2 fields from struct with 3 fields [StructInitElementCountMismatch] + // CHECK:STDERR: fail_init.carbon:[[@LINE+4]]:3: error: cannot initialize class with 2 fields from struct with 3 fields [StructInitElementCountMismatch] // CHECK:STDERR: {.a = 1, .b = 2, .c = 3} as Class; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: {.a = 1, .b = 2, .c = 3} as Class; } @@ -105,14 +106,14 @@ fn F() { // CHECK:STDOUT: %.loc26_18.5: init %i32 = initialize_from %.loc26_18.2 to %.loc26_18.4 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc26_18.6: ref %Class = temporary %.loc26_18.3, // CHECK:STDOUT: %.loc26_20: ref %Class = converted %.loc26_18.1, %.loc26_18.6 -// CHECK:STDOUT: %int_1.loc30: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %int_2.loc30: Core.IntLiteral = int_value 2 [template = constants.%int_2] +// CHECK:STDOUT: %int_1.loc31: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] +// CHECK:STDOUT: %int_2.loc31: Core.IntLiteral = int_value 2 [template = constants.%int_2] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %.loc30_26.1: %struct_type.a.b.c = struct_literal (%int_1.loc30, %int_2.loc30, %int_3) -// CHECK:STDOUT: %Class.ref.loc30: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %.loc30_26.2: ref %Class = temporary_storage -// CHECK:STDOUT: %.loc30_26.3: ref %Class = temporary %.loc30_26.2, -// CHECK:STDOUT: %.loc30_28: ref %Class = converted %.loc30_26.1, %.loc30_26.3 +// CHECK:STDOUT: %.loc31_26.1: %struct_type.a.b.c = struct_literal (%int_1.loc31, %int_2.loc31, %int_3) +// CHECK:STDOUT: %Class.ref.loc31: type = name_ref Class, file.%Class.decl [template = constants.%Class] +// CHECK:STDOUT: %.loc31_26.2: ref %Class = temporary_storage +// CHECK:STDOUT: %.loc31_26.3: ref %Class = temporary %.loc31_26.2, +// CHECK:STDOUT: %.loc31_28: ref %Class = converted %.loc31_26.1, %.loc31_26.3 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index 2b85f2d18860..66adc4e9ee77 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -19,9 +19,10 @@ fn F() { // TODO: This case should presumably work: `{...} as Class` should be an // initializing expression, not a value expression. // - // CHECK:STDERR: fail_init_as_inplace.carbon:[[@LINE+3]]:18: error: cannot copy value of type `Class` [CopyOfUncopyableType] + // CHECK:STDERR: fail_init_as_inplace.carbon:[[@LINE+4]]:18: error: cannot copy value of type `Class` [CopyOfUncopyableType] // CHECK:STDERR: var c: Class = {.a = 1, .b = 2} as Class; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: var c: Class = {.a = 1, .b = 2} as Class; G(&c); } @@ -104,27 +105,27 @@ fn F() { // CHECK:STDOUT: %c: ref %Class = bind_name c, %c.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc25_33.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) +// CHECK:STDOUT: %.loc26_33.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] -// CHECK:STDOUT: %impl.elem0.loc25_33.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc25_33.1: = bound_method %int_1, %impl.elem0.loc25_33.1 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc25_33.1: = specific_function %Convert.bound.loc25_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc25_33.1: init %i32 = call %Convert.specific_fn.loc25_33.1(%int_1) [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc25_33.2: init %i32 = converted %int_1, %int.convert_checked.loc25_33.1 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc25_33.3: ref %Class = temporary_storage -// CHECK:STDOUT: %.loc25_33.4: ref %i32 = class_element_access %.loc25_33.3, element0 -// CHECK:STDOUT: %.loc25_33.5: init %i32 = initialize_from %.loc25_33.2 to %.loc25_33.4 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc25_33.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc25_33.2: = bound_method %int_2, %impl.elem0.loc25_33.2 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc25_33.2: = specific_function %Convert.bound.loc25_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc25_33.2: init %i32 = call %Convert.specific_fn.loc25_33.2(%int_2) [template = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc25_33.6: init %i32 = converted %int_2, %int.convert_checked.loc25_33.2 [template = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc25_33.7: ref %i32 = class_element_access %.loc25_33.3, element1 -// CHECK:STDOUT: %.loc25_33.8: init %i32 = initialize_from %.loc25_33.6 to %.loc25_33.7 [template = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc25_33.9: init %Class = class_init (%.loc25_33.5, %.loc25_33.8), %.loc25_33.3 [template = constants.%Class.val] -// CHECK:STDOUT: %.loc25_33.10: ref %Class = temporary %.loc25_33.3, %.loc25_33.9 -// CHECK:STDOUT: %.loc25_35.1: ref %Class = converted %.loc25_33.1, %.loc25_33.10 -// CHECK:STDOUT: %.loc25_35.2: %Class = bind_value %.loc25_35.1 +// CHECK:STDOUT: %impl.elem0.loc26_33.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc26_33.1: = bound_method %int_1, %impl.elem0.loc26_33.1 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %Convert.specific_fn.loc26_33.1: = specific_function %Convert.bound.loc26_33.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc26_33.1: init %i32 = call %Convert.specific_fn.loc26_33.1(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc26_33.2: init %i32 = converted %int_1, %int.convert_checked.loc26_33.1 [template = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc26_33.3: ref %Class = temporary_storage +// CHECK:STDOUT: %.loc26_33.4: ref %i32 = class_element_access %.loc26_33.3, element0 +// CHECK:STDOUT: %.loc26_33.5: init %i32 = initialize_from %.loc26_33.2 to %.loc26_33.4 [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc26_33.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc26_33.2: = bound_method %int_2, %impl.elem0.loc26_33.2 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %Convert.specific_fn.loc26_33.2: = specific_function %Convert.bound.loc26_33.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc26_33.2: init %i32 = call %Convert.specific_fn.loc26_33.2(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc26_33.6: init %i32 = converted %int_2, %int.convert_checked.loc26_33.2 [template = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc26_33.7: ref %i32 = class_element_access %.loc26_33.3, element1 +// CHECK:STDOUT: %.loc26_33.8: init %i32 = initialize_from %.loc26_33.6 to %.loc26_33.7 [template = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc26_33.9: init %Class = class_init (%.loc26_33.5, %.loc26_33.8), %.loc26_33.3 [template = constants.%Class.val] +// CHECK:STDOUT: %.loc26_33.10: ref %Class = temporary %.loc26_33.3, %.loc26_33.9 +// CHECK:STDOUT: %.loc26_35.1: ref %Class = converted %.loc26_33.1, %.loc26_33.10 +// CHECK:STDOUT: %.loc26_35.2: %Class = bind_value %.loc26_35.1 // CHECK:STDOUT: assign %c.var, // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [template = constants.%G] // CHECK:STDOUT: %c.ref: ref %Class = name_ref c, %c diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index 712305b22cfe..b0d206d007b4 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -29,12 +29,13 @@ fn F(s: {.a: A}, b: B) { // `b` has an object representation for `A`, but this is still invalid for // consistency. - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+6]]:4: error: `addr self` method cannot be invoked on a value [AddrSelfIsNonRef] + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+7]]:4: error: `addr self` method cannot be invoked on a value [AddrSelfIsNonRef] // CHECK:STDERR: b.a.F(); // CHECK:STDERR: ^ // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-23]]:8: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: fn F[addr self: A*](); // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: b.a.F(); } @@ -125,11 +126,11 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: %F.call.loc28: init %empty_tuple.type = call %F.bound.loc28() // CHECK:STDOUT: %b.ref: %B = name_ref b, %b // CHECK:STDOUT: %a.ref: %B.elem = name_ref a, @B.%.loc16 [template = @B.%.loc16] -// CHECK:STDOUT: %.loc38_4.1: ref %A = class_element_access %b.ref, element0 -// CHECK:STDOUT: %.loc38_4.2: %A = bind_value %.loc38_4.1 -// CHECK:STDOUT: %F.ref.loc38: %F.type.649 = name_ref F, @A.%F.decl [template = constants.%F.485] -// CHECK:STDOUT: %F.bound.loc38: = bound_method %.loc38_4.2, %F.ref.loc38 -// CHECK:STDOUT: %F.call.loc38: init %empty_tuple.type = call %F.bound.loc38() +// CHECK:STDOUT: %.loc39_4.1: ref %A = class_element_access %b.ref, element0 +// CHECK:STDOUT: %.loc39_4.2: %A = bind_value %.loc39_4.1 +// CHECK:STDOUT: %F.ref.loc39: %F.type.649 = name_ref F, @A.%F.decl [template = constants.%F.485] +// CHECK:STDOUT: %F.bound.loc39: = bound_method %.loc39_4.2, %F.ref.loc39 +// CHECK:STDOUT: %F.call.loc39: init %empty_tuple.type = call %F.bound.loc39() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index ac1fbaf9c764..f227873961e7 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -17,12 +17,13 @@ let T: type = Class; // The class name is required to be written in the same way as in the class // declaration. An expression that evaluates to the class name is not accepted. -// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE+6]]:4: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope] +// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE+7]]:4: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope] // CHECK:STDERR: fn T.F() {} // CHECK:STDERR: ^ // CHECK:STDERR: fail_member_of_let.carbon:[[@LINE-7]]:5: note: referenced non-scope entity declared here [QualifiedNameNonScopeEntity] // CHECK:STDERR: let T: type = Class; // CHECK:STDERR: ^ +// CHECK:STDERR: fn T.F() {} // CHECK:STDOUT: --- fail_member_of_let.carbon diff --git a/toolchain/check/testdata/class/fail_method.carbon b/toolchain/check/testdata/class/fail_method.carbon index f10840fcf7bb..3a0d08b05808 100644 --- a/toolchain/check/testdata/class/fail_method.carbon +++ b/toolchain/check/testdata/class/fail_method.carbon @@ -37,12 +37,13 @@ fn F(c: Class) { // CHECK:STDERR: Class.WithSelf(c); - // CHECK:STDERR: fail_method.carbon:[[@LINE+6]]:3: error: missing object argument in method call [MissingObjectInMethodCall] + // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: error: missing object argument in method call [MissingObjectInMethodCall] // CHECK:STDERR: A(); // CHECK:STDERR: ^~~ // CHECK:STDERR: fail_method.carbon:[[@LINE-30]]:3: note: calling function declared here [InCallToFunction] // CHECK:STDERR: fn WithSelf[self: Class](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: A(); } @@ -127,7 +128,7 @@ fn F(c: Class) { // CHECK:STDOUT: %WithSelf.ref.loc38: %WithSelf.type = name_ref WithSelf, @Class.%WithSelf.decl [template = constants.%WithSelf] // CHECK:STDOUT: %c.ref.loc38: %Class = name_ref c, %c // CHECK:STDOUT: %A.ref: %WithSelf.type = name_ref A, file.%A [template = constants.%WithSelf] -// CHECK:STDOUT: %WithSelf.call.loc46: init %empty_tuple.type = call %A.ref() +// CHECK:STDOUT: %WithSelf.call.loc47: init %empty_tuple.type = call %A.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_method_modifiers.carbon b/toolchain/check/testdata/class/fail_method_modifiers.carbon index 3e6ae7d08d77..cfb972856cf4 100644 --- a/toolchain/check/testdata/class/fail_method_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_method_modifiers.carbon @@ -46,12 +46,13 @@ abstract class AbstractClass { base class BaseClass { - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+6]]:3: error: `abstract` not allowed; requires `abstract` class scope [ModifierAbstractNotAllowed] + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+7]]:3: error: `abstract` not allowed; requires `abstract` class scope [ModifierAbstractNotAllowed] // CHECK:STDERR: abstract fn Abstract[self: Self](); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: note: containing definition here [ModifierNotInContext] // CHECK:STDERR: base class BaseClass { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: abstract fn Abstract[self: Self](); } diff --git a/toolchain/check/testdata/class/fail_method_redefinition.carbon b/toolchain/check/testdata/class/fail_method_redefinition.carbon index 13cde1911788..fe67182ef340 100644 --- a/toolchain/check/testdata/class/fail_method_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_method_redefinition.carbon @@ -10,12 +10,13 @@ class Class { fn F() {} - // CHECK:STDERR: fail_method_redefinition.carbon:[[@LINE+6]]:3: error: redefinition of `fn F` [RedeclRedef] + // CHECK:STDERR: fail_method_redefinition.carbon:[[@LINE+7]]:3: error: redefinition of `fn F` [RedeclRedef] // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_method_redefinition.carbon:[[@LINE-4]]:3: note: previously defined here [RedeclPrevDef] // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: fn F() {} } diff --git a/toolchain/check/testdata/class/fail_modifiers.carbon b/toolchain/check/testdata/class/fail_modifiers.carbon index c52e72c01fcf..2df159ace7bf 100644 --- a/toolchain/check/testdata/class/fail_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_modifiers.carbon @@ -90,9 +90,10 @@ abstract class AbstractWithDefinition { abstract fn F() {} abstract fn G(); } -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:31: error: definition of `abstract` function [DefinedAbstractFunction] +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:31: error: definition of `abstract` function [DefinedAbstractFunction] // CHECK:STDERR: fn AbstractWithDefinition.G() { // CHECK:STDERR: ^ +// CHECK:STDERR: fn AbstractWithDefinition.G() { } diff --git a/toolchain/check/testdata/class/fail_out_of_line_decl.carbon b/toolchain/check/testdata/class/fail_out_of_line_decl.carbon index 98717eefe8f2..83a60d3e2cfd 100644 --- a/toolchain/check/testdata/class/fail_out_of_line_decl.carbon +++ b/toolchain/check/testdata/class/fail_out_of_line_decl.carbon @@ -10,9 +10,10 @@ class C {} -// CHECK:STDERR: fail_out_of_line_decl.carbon:[[@LINE+3]]:6: error: out-of-line declaration requires a declaration in scoped entity [QualifiedDeclOutsideScopeEntity] +// CHECK:STDERR: fail_out_of_line_decl.carbon:[[@LINE+4]]:6: error: out-of-line declaration requires a declaration in scoped entity [QualifiedDeclOutsideScopeEntity] // CHECK:STDERR: fn C.F() {} // CHECK:STDERR: ^ +// CHECK:STDERR: fn C.F() {} // CHECK:STDOUT: --- fail_out_of_line_decl.carbon diff --git a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon index 43fd9e7b24a7..16d448522b2b 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon @@ -19,9 +19,10 @@ class X { class A { class B; } class Y { - // CHECK:STDERR: fail_redeclaration_scope.carbon:[[@LINE+3]]:9: error: name `A` not found [NameNotFound] + // CHECK:STDERR: fail_redeclaration_scope.carbon:[[@LINE+4]]:9: error: name `A` not found [NameNotFound] // CHECK:STDERR: class A.B {} // CHECK:STDERR: ^ + // CHECK:STDERR: class A.B {} } diff --git a/toolchain/check/testdata/class/fail_redefinition.carbon b/toolchain/check/testdata/class/fail_redefinition.carbon index 2ef4eda412b8..e53962ab90de 100644 --- a/toolchain/check/testdata/class/fail_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_redefinition.carbon @@ -34,12 +34,13 @@ fn Class.F() {} // CHECK:STDERR: fn Class.G() {} fn Class.H() {} -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+6]]:1: error: redefinition of `fn I` [RedeclRedef] +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+7]]:1: error: redefinition of `fn I` [RedeclRedef] // CHECK:STDERR: fn Class.I() {} // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_redefinition.carbon:[[@LINE-26]]:3: note: previously defined here [RedeclPrevDef] // CHECK:STDERR: fn I() {} // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: fn Class.I() {} // CHECK:STDOUT: --- fail_redefinition.carbon @@ -85,7 +86,7 @@ fn Class.I() {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: %G.decl: %G.type.621 = fn_decl @G.2 [template = constants.%G.f0c] {} {} // CHECK:STDOUT: %H.decl: %H.type.91d = fn_decl @H.1 [template = constants.%H.d38] {} {} -// CHECK:STDOUT: %.decl.loc43: %.type = fn_decl @.1 [template = constants.%.d22] {} {} +// CHECK:STDOUT: %.decl.loc44: %.type = fn_decl @.1 [template = constants.%.d22] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index 88b10ca2b895..47d9fcf295a0 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -15,9 +15,10 @@ class Class { } fn G() -> i32 { - // CHECK:STDERR: fail_scope.carbon:[[@LINE+3]]:10: error: name `F` not found [NameNotFound] + // CHECK:STDERR: fail_scope.carbon:[[@LINE+4]]:10: error: name `F` not found [NameNotFound] // CHECK:STDERR: return F(); // CHECK:STDERR: ^ + // CHECK:STDERR: return F(); } diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index 3bcc7033613d..656a178316e7 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -43,15 +43,16 @@ class WrongSelf { } fn CallWrongSelf(ws: WrongSelf) { - // CHECK:STDERR: fail_self.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `WrongSelf` to `Class` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_self.carbon:[[@LINE+10]]:3: error: cannot implicitly convert from `WrongSelf` to `Class` [ImplicitAsConversionFailure] // CHECK:STDERR: ws.F(); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_self.carbon:[[@LINE+6]]:3: note: type `WrongSelf` does not implement interface `Core.ImplicitAs(Class)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_self.carbon:[[@LINE+7]]:3: note: type `WrongSelf` does not implement interface `Core.ImplicitAs(Class)` [MissingImplInMemberAccessNote] // CHECK:STDERR: ws.F(); // CHECK:STDERR: ^~ // CHECK:STDERR: fail_self.carbon:[[@LINE-10]]:8: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: fn F[self: Class](); // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: ws.F(); } @@ -172,7 +173,7 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %ws.ref: %WrongSelf = name_ref ws, %ws // CHECK:STDOUT: %F.ref: %F.type.25f = name_ref F, @WrongSelf.%F.decl [template = constants.%F.3a3] // CHECK:STDOUT: %F.bound: = bound_method %ws.ref, %F.ref -// CHECK:STDOUT: %.loc55: %Class = converted %ws.ref, [template = ] +// CHECK:STDOUT: %.loc56: %Class = converted %ws.ref, [template = ] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.bound() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_self_param.carbon b/toolchain/check/testdata/class/fail_self_param.carbon index 8abd9dab734c..8a73a5ac3f2d 100644 --- a/toolchain/check/testdata/class/fail_self_param.carbon +++ b/toolchain/check/testdata/class/fail_self_param.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_self_param.carbon -// CHECK:STDERR: fail_self_param.carbon:[[@LINE+3]]:9: error: `self` parameter only allowed on functions [SelfParameterNotAllowed] +// CHECK:STDERR: fail_self_param.carbon:[[@LINE+4]]:9: error: `self` parameter only allowed on functions [SelfParameterNotAllowed] // CHECK:STDERR: class C[self:! type](x:! self) {} // CHECK:STDERR: ^~~~~~~~~~~ +// CHECK:STDERR: class C[self:! type](x:! self) {} var v: C(0); @@ -39,8 +40,8 @@ var v: C(0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] { -// CHECK:STDOUT: %x.patt.loc14_22.1: = symbolic_binding_pattern x, 0 [symbolic = %x.patt.loc14_22.2 (constants.%x.patt)] -// CHECK:STDOUT: %x.param_patt: = value_param_pattern %x.patt.loc14_22.1, runtime_param [symbolic = %x.patt.loc14_22.2 (constants.%x.patt)] +// CHECK:STDOUT: %x.patt.loc15_22.1: = symbolic_binding_pattern x, 0 [symbolic = %x.patt.loc15_22.2 (constants.%x.patt)] +// CHECK:STDOUT: %x.param_patt: = value_param_pattern %x.patt.loc15_22.1, runtime_param [symbolic = %x.patt.loc15_22.2 (constants.%x.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param: = value_param runtime_param // CHECK:STDOUT: %self.ref: = name_ref self, [template = ] @@ -51,7 +52,7 @@ var v: C(0); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(%x: ) { -// CHECK:STDOUT: %x.patt.loc14_22.2: = symbolic_binding_pattern x, 0 [symbolic = %x.patt.loc14_22.2 (constants.%x.patt)] +// CHECK:STDOUT: %x.patt.loc15_22.2: = symbolic_binding_pattern x, 0 [symbolic = %x.patt.loc15_22.2 (constants.%x.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -62,6 +63,6 @@ var v: C(0); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C() { -// CHECK:STDOUT: %x.patt.loc14_22.2 => +// CHECK:STDOUT: %x.patt.loc15_22.2 => // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_self_type_member.carbon b/toolchain/check/testdata/class/fail_self_type_member.carbon index 35cc0774eff0..a22737d3eb16 100644 --- a/toolchain/check/testdata/class/fail_self_type_member.carbon +++ b/toolchain/check/testdata/class/fail_self_type_member.carbon @@ -14,13 +14,14 @@ class Class { fn F() -> bool { var c1: Class = {.b = true}; - // CHECK:STDERR: fail_self_type_member.carbon:[[@LINE+7]]:17: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] + // CHECK:STDERR: fail_self_type_member.carbon:[[@LINE+8]]:17: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] // CHECK:STDERR: var c2: Class.Self = c1; // CHECK:STDERR: ^~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_self_type_member.carbon:[[@LINE+3]]:17: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] + // CHECK:STDERR: fail_self_type_member.carbon:[[@LINE+4]]:17: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] // CHECK:STDERR: var c2: Class.Self = c1; // CHECK:STDERR: ^~~~ + // CHECK:STDERR: var c2: Class.Self = c1; return c2.b; } diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index 6ed67eeb3a52..bf0d1be4d999 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -20,9 +20,10 @@ class Class { } fn G() -> i32 { - // CHECK:STDERR: fail_unbound_field.carbon:[[@LINE+3]]:10: error: expression cannot be used as a value [UseOfNonExprAsValue] + // CHECK:STDERR: fail_unbound_field.carbon:[[@LINE+4]]:10: error: expression cannot be used as a value [UseOfNonExprAsValue] // CHECK:STDERR: return Class.field; // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: return Class.field; } diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index 1324ea11f631..42dfc06697cf 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -14,9 +14,10 @@ class Class { fn G(c: Class) -> i32 { // TODO: Mention the scope in which we looked for the name. - // CHECK:STDERR: fail_unknown_member.carbon:[[@LINE+3]]:10: error: member name `something` not found in `Class` [MemberNameNotFoundInScope] + // CHECK:STDERR: fail_unknown_member.carbon:[[@LINE+4]]:10: error: member name `something` not found in `Class` [MemberNameNotFoundInScope] // CHECK:STDERR: return c.something; // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: return c.something; } diff --git a/toolchain/check/testdata/class/generic/adapt.carbon b/toolchain/check/testdata/class/generic/adapt.carbon index 2e885f1de42f..7fdb5bf91bb2 100644 --- a/toolchain/check/testdata/class/generic/adapt.carbon +++ b/toolchain/check/testdata/class/generic/adapt.carbon @@ -81,12 +81,13 @@ import library "extend_adapt_specific_type_library"; fn ImportedAccess(a: Adapter) -> i32 { // TODO: This should presumably work, but the design doesn't say how yet. - // CHECK:STDERR: fail_todo_import_extend_adapt_specific_type.carbon:[[@LINE+6]]:10: error: cannot implicitly convert from `Adapter` to `C(i32)` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_todo_import_extend_adapt_specific_type.carbon:[[@LINE+7]]:10: error: cannot implicitly convert from `Adapter` to `C(i32)` [ImplicitAsConversionFailure] // CHECK:STDERR: return a.x; // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_todo_import_extend_adapt_specific_type.carbon:[[@LINE+3]]:10: note: type `Adapter` does not implement interface `Core.ImplicitAs(C(i32))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_todo_import_extend_adapt_specific_type.carbon:[[@LINE+4]]:10: note: type `Adapter` does not implement interface `Core.ImplicitAs(C(i32))` [MissingImplInMemberAccessNote] // CHECK:STDERR: return a.x; // CHECK:STDERR: ^~~ + // CHECK:STDERR: return a.x; } @@ -669,8 +670,8 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %Adapter = name_ref a, %a // CHECK:STDOUT: %x.ref: %C.elem.ed6 = name_ref x, imports.%import_ref.262 [template = imports.%.22b] -// CHECK:STDOUT: %.loc14_11.1: %C.239 = converted %a.ref, [template = ] -// CHECK:STDOUT: %.loc14_11.2: %i32 = class_element_access , element0 [template = ] +// CHECK:STDOUT: %.loc15_11.1: %C.239 = converted %a.ref, [template = ] +// CHECK:STDOUT: %.loc15_11.2: %i32 = class_element_access , element0 [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/base_is_generic.carbon b/toolchain/check/testdata/class/generic/base_is_generic.carbon index 9ffe2b222674..81522f720c2d 100644 --- a/toolchain/check/testdata/class/generic/base_is_generic.carbon +++ b/toolchain/check/testdata/class/generic/base_is_generic.carbon @@ -43,9 +43,10 @@ fn ImportedDoubleFieldAccess(d: Derived) -> i32 { library "[[@TEST_NAME]]"; class C(T:! type) { - // CHECK:STDERR: fail_todo_extend_symbolic_base.carbon:[[@LINE+3]]:16: error: deriving from final type `T`; base type must be an `abstract` or `base` class [BaseIsFinal] + // CHECK:STDERR: fail_todo_extend_symbolic_base.carbon:[[@LINE+4]]:16: error: deriving from final type `T`; base type must be an `abstract` or `base` class [BaseIsFinal] // CHECK:STDERR: extend base: T; // CHECK:STDERR: ^ + // CHECK:STDERR: extend base: T; } @@ -401,7 +402,7 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_9.1 [symbolic = %T.loc4_9.2 (constants.%T)] -// CHECK:STDOUT: %.loc8: = base_decl , element0 [template] +// CHECK:STDOUT: %.loc9: = base_decl , element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness [template = ] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index aaa7591f81a5..eb70faa00951 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -55,15 +55,16 @@ library "[[@TEST_NAME]]"; class Class(T:! type, N:! i32) {} -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+9]]:8: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+10]]:8: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: var a: Class(5, i32*); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:8: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+7]]:8: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var a: Class(5, i32*); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_no_conversion.carbon:[[@LINE-8]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: class Class(T:! type, N:! i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: var a: Class(5, i32*); // --- call_in_nested_return_type.carbon diff --git a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon index 32a3e14f3432..38b53e508424 100644 --- a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon +++ b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon @@ -24,9 +24,10 @@ class A(N:! i32) { } fn F(a: A(0)*) { - // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+3]]:3: note: in `A(0)` used here [ResolvingSpecificHere] + // CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+4]]:3: note: in `A(0)` used here [ResolvingSpecificHere] // CHECK:STDERR: let b: B* = a; // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: let b: B* = a; } @@ -182,11 +183,11 @@ fn F(a: A(0)*) { // CHECK:STDOUT: fn @F(%a.param_patt: %ptr.b65) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %ptr.b65 = name_ref a, %a -// CHECK:STDOUT: %.loc19_16.1: ref %A.6fc = deref %a.ref -// CHECK:STDOUT: %.loc19_16.2: ref %B = class_element_access %.loc19_16.1, element0 -// CHECK:STDOUT: %addr: %ptr.e79 = addr_of %.loc19_16.2 -// CHECK:STDOUT: %.loc19_16.3: %ptr.e79 = converted %a.ref, %addr -// CHECK:STDOUT: %b: %ptr.e79 = bind_name b, %.loc19_16.3 +// CHECK:STDOUT: %.loc20_16.1: ref %A.6fc = deref %a.ref +// CHECK:STDOUT: %.loc20_16.2: ref %B = class_element_access %.loc20_16.1, element0 +// CHECK:STDOUT: %addr: %ptr.e79 = addr_of %.loc20_16.2 +// CHECK:STDOUT: %.loc20_16.3: %ptr.e79 = converted %a.ref, %addr +// CHECK:STDOUT: %b: %ptr.e79 = bind_name b, %.loc20_16.3 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 95f1a2c824b9..ce7df86ab5f3 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -78,9 +78,10 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: class Class(U:! type) { - // CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+3]]:10: error: name `T` not found [NameNotFound] + // CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+4]]:10: error: name `T` not found [NameNotFound] // CHECK:STDERR: var x: T; // CHECK:STDERR: ^ + // CHECK:STDERR: var x: T; } @@ -746,7 +747,7 @@ class Class(U:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %.loc16: = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc17: = field_decl x, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness [template = ] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index b5ccabd39fe0..f902bf4019bc 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -39,12 +39,13 @@ class Class(T:! type) { } fn StaticMemberFunctionCall(T:! type) -> Class(T) { - // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `Class(T)` to `Class(T)` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `Class(T)` to `Class(T)` [ImplicitAsConversionFailure] // CHECK:STDERR: return Class(T).Make(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+3]]:3: note: type `Class(T)` does not implement interface `Core.ImplicitAs(Class(T))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+4]]:3: note: type `Class(T)` does not implement interface `Core.ImplicitAs(Class(T))` [MissingImplInMemberAccessNote] // CHECK:STDERR: return Class(T).Make(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: return Class(T).Make(); } @@ -494,24 +495,24 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Class.loc8_49.2: type = class_type @Class, @Class(%T.loc8_29.2) [symbolic = %Class.loc8_49.2 (constants.%Class)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc15_18: = require_complete_type @StaticMemberFunctionCall.%Class.loc8_49.2 (%Class) [symbolic = %require_complete.loc15_18 (constants.%require_complete.4f8)] +// CHECK:STDOUT: %require_complete.loc16_18: = require_complete_type @StaticMemberFunctionCall.%Class.loc8_49.2 (%Class) [symbolic = %require_complete.loc16_18 (constants.%require_complete.4f8)] // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Class(%T.loc8_29.2) [symbolic = %Make.type (constants.%Make.type)] // CHECK:STDOUT: %Make: @StaticMemberFunctionCall.%Make.type (%Make.type) = struct_value () [symbolic = %Make (constants.%Make)] -// CHECK:STDOUT: %Make.specific_fn.loc15_18.2: = specific_function %Make, @Make(%T.loc8_29.2) [symbolic = %Make.specific_fn.loc15_18.2 (constants.%Make.specific_fn)] +// CHECK:STDOUT: %Make.specific_fn.loc16_18.2: = specific_function %Make, @Make(%T.loc8_29.2) [symbolic = %Make.specific_fn.loc16_18.2 (constants.%Make.specific_fn)] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Class.loc8_49.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.53b)] -// CHECK:STDOUT: %require_complete.loc15_25: = require_complete_type @StaticMemberFunctionCall.%ImplicitAs.type (%ImplicitAs.type.53b) [symbolic = %require_complete.loc15_25 (constants.%require_complete.d81)] +// CHECK:STDOUT: %require_complete.loc16_25: = require_complete_type @StaticMemberFunctionCall.%ImplicitAs.type (%ImplicitAs.type.53b) [symbolic = %require_complete.loc16_25 (constants.%require_complete.d81)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) -> %return.param_patt: @StaticMemberFunctionCall.%Class.loc8_49.2 (%Class) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref.loc15: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] -// CHECK:STDOUT: %T.ref.loc15: type = name_ref T, %T.loc8_29.1 [symbolic = %T.loc8_29.2 (constants.%T)] -// CHECK:STDOUT: %Class.loc15: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.loc8_49.2 (constants.%Class)] -// CHECK:STDOUT: %.loc15_18: @StaticMemberFunctionCall.%Make.type (%Make.type) = specific_constant @Class.%Make.decl, @Class(constants.%T) [symbolic = %Make (constants.%Make)] -// CHECK:STDOUT: %Make.ref: @StaticMemberFunctionCall.%Make.type (%Make.type) = name_ref Make, %.loc15_18 [symbolic = %Make (constants.%Make)] -// CHECK:STDOUT: %Make.specific_fn.loc15_18.1: = specific_function %Make.ref, @Make(constants.%T) [symbolic = %Make.specific_fn.loc15_18.2 (constants.%Make.specific_fn)] -// CHECK:STDOUT: %.loc15_24: ref @StaticMemberFunctionCall.%Class.loc8_49.2 (%Class) = temporary_storage -// CHECK:STDOUT: %Make.call: init @StaticMemberFunctionCall.%Class.loc8_49.2 (%Class) = call %Make.specific_fn.loc15_18.1() to %.loc15_24 -// CHECK:STDOUT: %.loc15_25: @StaticMemberFunctionCall.%Class.loc8_49.2 (%Class) = converted %Make.call, [template = ] +// CHECK:STDOUT: %Class.ref.loc16: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.generic] +// CHECK:STDOUT: %T.ref.loc16: type = name_ref T, %T.loc8_29.1 [symbolic = %T.loc8_29.2 (constants.%T)] +// CHECK:STDOUT: %Class.loc16: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.loc8_49.2 (constants.%Class)] +// CHECK:STDOUT: %.loc16_18: @StaticMemberFunctionCall.%Make.type (%Make.type) = specific_constant @Class.%Make.decl, @Class(constants.%T) [symbolic = %Make (constants.%Make)] +// CHECK:STDOUT: %Make.ref: @StaticMemberFunctionCall.%Make.type (%Make.type) = name_ref Make, %.loc16_18 [symbolic = %Make (constants.%Make)] +// CHECK:STDOUT: %Make.specific_fn.loc16_18.1: = specific_function %Make.ref, @Make(constants.%T) [symbolic = %Make.specific_fn.loc16_18.2 (constants.%Make.specific_fn)] +// CHECK:STDOUT: %.loc16_24: ref @StaticMemberFunctionCall.%Class.loc8_49.2 (%Class) = temporary_storage +// CHECK:STDOUT: %Make.call: init @StaticMemberFunctionCall.%Class.loc8_49.2 (%Class) = call %Make.specific_fn.loc16_18.1() to %.loc16_24 +// CHECK:STDOUT: %.loc16_25: @StaticMemberFunctionCall.%Class.loc8_49.2 (%Class) = converted %Make.call, [template = ] // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/member_inline.carbon b/toolchain/check/testdata/class/generic/member_inline.carbon index f39bc32dbd8e..cb54ec4f4e89 100644 --- a/toolchain/check/testdata/class/generic/member_inline.carbon +++ b/toolchain/check/testdata/class/generic/member_inline.carbon @@ -30,9 +30,10 @@ library "fail_member_inline.carbon"; class C(T:! type) { fn F() { - // CHECK:STDERR: fail_member_inline.carbon:[[@LINE+3]]:5: error: expression cannot be used as a value [UseOfNonExprAsValue] + // CHECK:STDERR: fail_member_inline.carbon:[[@LINE+4]]:5: error: expression cannot be used as a value [UseOfNonExprAsValue] // CHECK:STDERR: data; // CHECK:STDERR: ^~~~ + // CHECK:STDERR: data; } var data: {}; @@ -241,7 +242,7 @@ class C(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %F.decl: @C.%F.type (%F.type) = fn_decl @F [symbolic = @C.%F (constants.%F)] {} {} -// CHECK:STDOUT: %.loc11: @C.%C.elem (%C.elem) = field_decl data, element0 [template] +// CHECK:STDOUT: %.loc12: @C.%C.elem (%C.elem) = field_decl data, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.data [template = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -255,7 +256,7 @@ class C(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %data.ref: @F.%C.elem (%C.elem) = name_ref data, @C.%.loc11 [template = @C.%.loc11] +// CHECK:STDOUT: %data.ref: @F.%C.elem (%C.elem) = name_ref data, @C.%.loc12 [template = @C.%.loc12] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/member_lookup.carbon b/toolchain/check/testdata/class/generic/member_lookup.carbon index 77bc60824460..fdc5abda45b3 100644 --- a/toolchain/check/testdata/class/generic/member_lookup.carbon +++ b/toolchain/check/testdata/class/generic/member_lookup.carbon @@ -63,9 +63,10 @@ fn AccessMissingDerived[T:! type](x: Derived(T)) -> T { } fn AccessMissingConcrete(x: Derived(i32)) -> i32 { - // CHECK:STDERR: fail_no_member.carbon:[[@LINE+3]]:10: error: member name `nonesuch` not found in `Derived(i32)` [MemberNameNotFoundInScope] + // CHECK:STDERR: fail_no_member.carbon:[[@LINE+4]]:10: error: member name `nonesuch` not found in `Derived(i32)` [MemberNameNotFoundInScope] // CHECK:STDERR: return x.nonesuch; // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: return x.nonesuch; } diff --git a/toolchain/check/testdata/class/generic/member_out_of_line.carbon b/toolchain/check/testdata/class/generic/member_out_of_line.carbon index 945e38e5369f..c2b7c2b40187 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -97,12 +97,13 @@ class Generic(T:! type) { fn WrongType(); } -// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE+6]]:12: error: type `()` of parameter 1 in redeclaration differs from previous parameter type `type` [RedeclParamDiffersType] +// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE+7]]:12: error: type `()` of parameter 1 in redeclaration differs from previous parameter type `type` [RedeclParamDiffersType] // CHECK:STDERR: fn Generic(T:! ()).WrongType() {} // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE-7]]:15: note: previous declaration's corresponding parameter here [RedeclParamPrevious] // CHECK:STDERR: class Generic(T:! type) { // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: --- basic.carbon @@ -719,11 +720,11 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.d85] {} { // CHECK:STDOUT: %T.param: %empty_tuple.type = value_param runtime_param -// CHECK:STDOUT: %.loc14_17.1: type = splice_block %.loc14_17.3 [template = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc14_17.2: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc14_17.3: type = converted %.loc14_17.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc15_17.1: type = splice_block %.loc15_17.3 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc15_17.2: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc15_17.3: type = converted %.loc15_17.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc14_12.1: %empty_tuple.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc14_12.2 (constants.%T.7a6)] +// CHECK:STDOUT: %T.loc15_12.1: %empty_tuple.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc15_12.2 (constants.%T.7a6)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -747,8 +748,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @.1(%T.loc14_12.1: %empty_tuple.type) { -// CHECK:STDOUT: %T.loc14_12.2: %empty_tuple.type = bind_symbolic_name T, 0 [symbolic = %T.loc14_12.2 (constants.%T.7a6)] +// CHECK:STDOUT: generic fn @.1(%T.loc15_12.1: %empty_tuple.type) { +// CHECK:STDOUT: %T.loc15_12.2: %empty_tuple.type = bind_symbolic_name T, 0 [symbolic = %T.loc15_12.2 (constants.%T.7a6)] // CHECK:STDOUT: %T.patt: %empty_tuple.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.e60)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -769,7 +770,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: specific @Generic(%T.loc4_15.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T.7a6) { -// CHECK:STDOUT: %T.loc14_12.2 => constants.%T.7a6 +// CHECK:STDOUT: %T.loc15_12.2 => constants.%T.7a6 // CHECK:STDOUT: %T.patt => constants.%T.7a6 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/redeclare.carbon b/toolchain/check/testdata/class/generic/redeclare.carbon index cbb2a8acb92d..e2958dedece1 100644 --- a/toolchain/check/testdata/class/generic/redeclare.carbon +++ b/toolchain/check/testdata/class/generic/redeclare.carbon @@ -78,12 +78,13 @@ class D(T:! i32) {} library "[[@TEST_NAME]]"; class E(T:! type); -// CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE+6]]:9: error: redeclaration differs at parameter 1 [RedeclParamDiffers] +// CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE+7]]:9: error: redeclaration differs at parameter 1 [RedeclParamDiffers] // CHECK:STDERR: class E(U:! type) {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE-4]]:9: note: previous declaration's corresponding parameter here [RedeclParamPrevious] // CHECK:STDERR: class E(T:! type); // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: class E(U:! type) {} // CHECK:STDOUT: --- valid.carbon @@ -492,11 +493,11 @@ class E(U:! type) {} // CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_9.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.generic] { -// CHECK:STDOUT: %U.patt.loc11_9.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_9.2 (constants.%U.patt)] -// CHECK:STDOUT: %U.param_patt: type = value_param_pattern %U.patt.loc11_9.1, runtime_param [symbolic = %U.patt.loc11_9.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.patt.loc12_9.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc12_9.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: type = value_param_pattern %U.patt.loc12_9.1, runtime_param [symbolic = %U.patt.loc12_9.2 (constants.%U.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %U.param: type = value_param runtime_param -// CHECK:STDOUT: %U.loc11_9.1: type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc11_9.2 (constants.%U)] +// CHECK:STDOUT: %U.loc12_9.1: type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc12_9.2 (constants.%U)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -507,9 +508,9 @@ class E(U:! type) {} // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(%U.loc11_9.1: type) { -// CHECK:STDOUT: %U.loc11_9.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc11_9.2 (constants.%U)] -// CHECK:STDOUT: %U.patt.loc11_9.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_9.2 (constants.%U.patt)] +// CHECK:STDOUT: generic class @.1(%U.loc12_9.1: type) { +// CHECK:STDOUT: %U.loc12_9.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc12_9.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc12_9.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc12_9.2 (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -525,7 +526,7 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%U) { -// CHECK:STDOUT: %U.loc11_9.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc11_9.2 => constants.%U +// CHECK:STDOUT: %U.loc12_9.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc12_9.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index 47b3efdad08e..b07a7af503c8 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -72,19 +72,20 @@ class D { class E(F:! D) {} -// CHECK:STDERR: fail_class_param.carbon:[[@LINE+13]]:8: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant] +// CHECK:STDERR: fail_class_param.carbon:[[@LINE+14]]:8: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant] // CHECK:STDERR: var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_class_param.carbon:[[@LINE-5]]:9: note: initializing generic parameter `F` declared here [InitializingGenericParam] // CHECK:STDERR: class E(F:! D) {} // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_class_param.carbon:[[@LINE+6]]:36: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant] +// CHECK:STDERR: fail_class_param.carbon:[[@LINE+7]]:36: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant] // CHECK:STDERR: var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_class_param.carbon:[[@LINE-12]]:9: note: initializing generic parameter `F` declared here [InitializingGenericParam] // CHECK:STDERR: class E(F:! D) {} // CHECK:STDERR: ^ +// CHECK:STDERR: var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: --- fail_empty_params.carbon @@ -425,31 +426,31 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc24_31: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc25_31: %empty_struct_type = struct_literal () // CHECK:STDOUT: %E.ref: %E.type = name_ref E, file.%E.decl [template = constants.%E.generic] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] -// CHECK:STDOUT: %.loc24_53.1: %struct_type.a.b.cfd = struct_literal (%int_3, %int_4) +// CHECK:STDOUT: %.loc25_53.1: %struct_type.a.b.cfd = struct_literal (%int_3, %int_4) // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] -// CHECK:STDOUT: %impl.elem0.loc24_53.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc24_53.1: = bound_method %int_3, %impl.elem0.loc24_53.1 [template = constants.%Convert.bound.b30] -// CHECK:STDOUT: %Convert.specific_fn.loc24_53.1: = specific_function %Convert.bound.loc24_53.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] -// CHECK:STDOUT: %int.convert_checked.loc24_53.1: init %i32 = call %Convert.specific_fn.loc24_53.1(%int_3) [template = constants.%int_3.822] -// CHECK:STDOUT: %.loc24_53.2: init %i32 = converted %int_3, %int.convert_checked.loc24_53.1 [template = constants.%int_3.822] -// CHECK:STDOUT: %.loc24_53.3: ref %D = temporary_storage -// CHECK:STDOUT: %.loc24_53.4: ref %i32 = class_element_access %.loc24_53.3, element0 -// CHECK:STDOUT: %.loc24_53.5: init %i32 = initialize_from %.loc24_53.2 to %.loc24_53.4 [template = constants.%int_3.822] -// CHECK:STDOUT: %impl.elem0.loc24_53.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc24_53.2: = bound_method %int_4, %impl.elem0.loc24_53.2 [template = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %Convert.specific_fn.loc24_53.2: = specific_function %Convert.bound.loc24_53.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc24_53.2: init %i32 = call %Convert.specific_fn.loc24_53.2(%int_4) [template = constants.%int_4.940] -// CHECK:STDOUT: %.loc24_53.6: init %i32 = converted %int_4, %int.convert_checked.loc24_53.2 [template = constants.%int_4.940] -// CHECK:STDOUT: %.loc24_53.7: ref %i32 = class_element_access %.loc24_53.3, element1 -// CHECK:STDOUT: %.loc24_53.8: init %i32 = initialize_from %.loc24_53.6 to %.loc24_53.7 [template = constants.%int_4.940] -// CHECK:STDOUT: %.loc24_53.9: init %D = class_init (%.loc24_53.5, %.loc24_53.8), %.loc24_53.3 [template = constants.%D.val.835] -// CHECK:STDOUT: %.loc24_53.10: ref %D = temporary %.loc24_53.3, %.loc24_53.9 -// CHECK:STDOUT: %.loc24_55.1: ref %D = converted %.loc24_53.1, %.loc24_53.10 -// CHECK:STDOUT: %.loc24_55.2: %D = bind_value %.loc24_55.1 +// CHECK:STDOUT: %impl.elem0.loc25_53.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc25_53.1: = bound_method %int_3, %impl.elem0.loc25_53.1 [template = constants.%Convert.bound.b30] +// CHECK:STDOUT: %Convert.specific_fn.loc25_53.1: = specific_function %Convert.bound.loc25_53.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42] +// CHECK:STDOUT: %int.convert_checked.loc25_53.1: init %i32 = call %Convert.specific_fn.loc25_53.1(%int_3) [template = constants.%int_3.822] +// CHECK:STDOUT: %.loc25_53.2: init %i32 = converted %int_3, %int.convert_checked.loc25_53.1 [template = constants.%int_3.822] +// CHECK:STDOUT: %.loc25_53.3: ref %D = temporary_storage +// CHECK:STDOUT: %.loc25_53.4: ref %i32 = class_element_access %.loc25_53.3, element0 +// CHECK:STDOUT: %.loc25_53.5: init %i32 = initialize_from %.loc25_53.2 to %.loc25_53.4 [template = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc25_53.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc25_53.2: = bound_method %int_4, %impl.elem0.loc25_53.2 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %Convert.specific_fn.loc25_53.2: = specific_function %Convert.bound.loc25_53.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc25_53.2: init %i32 = call %Convert.specific_fn.loc25_53.2(%int_4) [template = constants.%int_4.940] +// CHECK:STDOUT: %.loc25_53.6: init %i32 = converted %int_4, %int.convert_checked.loc25_53.2 [template = constants.%int_4.940] +// CHECK:STDOUT: %.loc25_53.7: ref %i32 = class_element_access %.loc25_53.3, element1 +// CHECK:STDOUT: %.loc25_53.8: init %i32 = initialize_from %.loc25_53.6 to %.loc25_53.7 [template = constants.%int_4.940] +// CHECK:STDOUT: %.loc25_53.9: init %D = class_init (%.loc25_53.5, %.loc25_53.8), %.loc25_53.3 [template = constants.%D.val.835] +// CHECK:STDOUT: %.loc25_53.10: ref %D = temporary %.loc25_53.3, %.loc25_53.9 +// CHECK:STDOUT: %.loc25_55.1: ref %D = converted %.loc25_53.1, %.loc25_53.10 +// CHECK:STDOUT: %.loc25_55.2: %D = bind_value %.loc25_55.1 // CHECK:STDOUT: assign file.%g.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index aaad8861a00f..c965aed3e90d 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -200,12 +200,13 @@ base class A { class B { extend base: A; fn F[self: Self]() { - // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE+6]]:11: error: cannot access private member `x` of type `A` [ClassInvalidMemberAccess] + // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE+7]]:11: error: cannot access private member `x` of type `A` [ClassInvalidMemberAccess] // CHECK:STDERR: self.(A.x); // CHECK:STDERR: ^~~ // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE-9]]:15: note: declared here [ClassMemberDeclaration] // CHECK:STDERR: private var x: i32; // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: self.(A.x); } } diff --git a/toolchain/check/testdata/class/no_prelude/extern.carbon b/toolchain/check/testdata/class/no_prelude/extern.carbon index 73e4c56a1b6f..ebdb64529443 100644 --- a/toolchain/check/testdata/class/no_prelude/extern.carbon +++ b/toolchain/check/testdata/class/no_prelude/extern.carbon @@ -272,13 +272,14 @@ library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE+7]]:1: error: redeclarations of `class C` must match use of `extern` [RedeclExternMismatch] +// CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE+8]]:1: error: redeclarations of `class C` must match use of `extern` [RedeclExternMismatch] // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE-5]]:1: in import [InImport] // CHECK:STDERR: def.carbon:4:1: note: previously declared here [RedeclPrevDecl] // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: extern class C; // CHECK:STDOUT: --- decl.carbon diff --git a/toolchain/check/testdata/class/no_prelude/extern_library.carbon b/toolchain/check/testdata/class/no_prelude/extern_library.carbon index 38b12724e8de..d0e314b973a4 100644 --- a/toolchain/check/testdata/class/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/class/no_prelude/extern_library.carbon @@ -10,9 +10,10 @@ // --- fail_todo.carbon -// CHECK:STDERR: fail_todo.carbon:[[@LINE+3]]:1: error: semantics TODO: `extern library` [SemanticsTodo] +// CHECK:STDERR: fail_todo.carbon:[[@LINE+4]]:1: error: semantics TODO: `extern library` [SemanticsTodo] // CHECK:STDERR: extern library "foo" class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: extern library "foo" class C; // CHECK:STDOUT: --- fail_todo.carbon diff --git a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon index fb97e365aef1..24a76bfdbc86 100644 --- a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon @@ -43,9 +43,10 @@ class A[T: type]() {} library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:9: error: parameters of generic types must be constant [GenericParamMustBeConstant] +// CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+4]]:9: error: parameters of generic types must be constant [GenericParamMustBeConstant] // CHECK:STDERR: class A(T: type) {} // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: class A(T: type) {} // This is testing a use of the invalid type. @@ -306,11 +307,11 @@ fn F(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: %A.type = class_decl @A [template = constants.%A.generic] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %T.patt.loc10_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] -// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc10_6.1, runtime_param [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.patt.loc11_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc11_6.1, runtime_param [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.param: type = value_param runtime_param -// CHECK:STDOUT: %T.loc10_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_6.2 (constants.%T)] +// CHECK:STDOUT: %T.loc11_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -319,23 +320,23 @@ fn F(T:! type) { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc10_6.1: type) { -// CHECK:STDOUT: %T.loc10_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_6.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc10_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_6.2 (constants.%T.patt)] +// CHECK:STDOUT: generic fn @F(%T.loc11_6.1: type) { +// CHECK:STDOUT: %T.loc11_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_6.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A.generic] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)] // CHECK:STDOUT: %A: type = class_type @A [template = constants.%A] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { -// CHECK:STDOUT: %T.loc10_6.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc10_6.2 => constants.%T +// CHECK:STDOUT: %T.loc11_6.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc11_6.2 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon index 3040acd6d34f..7fe0a52fd775 100644 --- a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon @@ -71,13 +71,14 @@ alias B = C; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] +// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: class B {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE-5]]:6: in import [InImport] // CHECK:STDERR: def_alias.carbon:5:7: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: alias B = C; // CHECK:STDERR: ^ +// CHECK:STDERR: class B {} // CHECK:STDOUT: --- basic.carbon diff --git a/toolchain/check/testdata/class/no_prelude/import_access.carbon b/toolchain/check/testdata/class/no_prelude/import_access.carbon index 94546289d52e..d849f47119d0 100644 --- a/toolchain/check/testdata/class/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/class/no_prelude/import_access.carbon @@ -122,9 +122,10 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward"; -// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:9: error: member name `Forward` not found in `Test` [MemberNameNotFoundInScope] +// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+4]]:9: error: member name `Forward` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: fn F(c: Test.Forward*) {} // CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: fn F(c: Test.Forward*) {} // --- todo_fail_private_on_redecl.carbon @@ -469,7 +470,7 @@ private class Redecl {} // CHECK:STDOUT: %c.param_patt: = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %c.param: = value_param runtime_param0 -// CHECK:STDOUT: %.loc9: type = splice_block %ptr [template = ] { +// CHECK:STDOUT: %.loc10: type = splice_block %ptr [template = ] { // CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] // CHECK:STDOUT: %ptr: type = ptr_type [template = ] diff --git a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon index 2acef044c4df..eae7928e8f08 100644 --- a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon @@ -66,9 +66,10 @@ library "[[@TEST_NAME]]"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: error: no definition found for declaration in impl file [MissingDefinitionInImpl] +// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file [MissingDefinitionInImpl] // CHECK:STDERR: class D; // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: class D; // CHECK:STDOUT: --- decl_in_api_definition_in_impl.carbon diff --git a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon index 73565f18a508..c2c12a0f9b05 100644 --- a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon @@ -169,12 +169,13 @@ base class Base { fn F[addr self: Self*](); } -// CHECK:STDERR: fail_self_type.carbon:[[@LINE+6]]:22: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] +// CHECK:STDERR: fail_self_type.carbon:[[@LINE+7]]:22: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] // CHECK:STDERR: fn Base.F[addr self: Base*]() { // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_self_type.carbon:[[@LINE-6]]:19: note: comparing with previous declaration here [RedeclParamSyntaxPrevious] // CHECK:STDERR: fn F[addr self: Self*](); // CHECK:STDERR: ^~~~ +// CHECK:STDERR: fn Base.F[addr self: Base*]() { (*self).a = (); } @@ -1054,10 +1055,10 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.ad0] { // CHECK:STDOUT: %self.patt: %ptr.11f = binding_pattern self // CHECK:STDOUT: %self.param_patt: %ptr.11f = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %.loc16_11: auto = addr_pattern %self.param_patt +// CHECK:STDOUT: %.loc17_11: auto = addr_pattern %self.param_patt // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: %ptr.11f = value_param runtime_param0 -// CHECK:STDOUT: %.loc16_26: type = splice_block %ptr [template = constants.%ptr.11f] { +// CHECK:STDOUT: %.loc17_26: type = splice_block %ptr [template = constants.%ptr.11f] { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %ptr: type = ptr_type %Base [template = constants.%ptr.11f] // CHECK:STDOUT: } @@ -1088,13 +1089,13 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: fn @.1[addr %self.param_patt: %ptr.11f]() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %ptr.11f = name_ref self, %self -// CHECK:STDOUT: %.loc17_4: ref %Base = deref %self.ref +// CHECK:STDOUT: %.loc18_4: ref %Base = deref %self.ref // CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc5 [template = @Base.%.loc5] -// CHECK:STDOUT: %.loc17_10: ref %empty_tuple.type = class_element_access %.loc17_4, element0 -// CHECK:STDOUT: %.loc17_16.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc17_16.2: init %empty_tuple.type = tuple_init () to %.loc17_10 [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc17_13: init %empty_tuple.type = converted %.loc17_16.1, %.loc17_16.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: assign %.loc17_10, %.loc17_13 +// CHECK:STDOUT: %.loc18_10: ref %empty_tuple.type = class_element_access %.loc18_4, element0 +// CHECK:STDOUT: %.loc18_16.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc18_16.2: init %empty_tuple.type = tuple_init () to %.loc18_10 [template = constants.%empty_tuple] +// CHECK:STDOUT: %.loc18_13: init %empty_tuple.type = converted %.loc18_16.1, %.loc18_16.2 [template = constants.%empty_tuple] +// CHECK:STDOUT: assign %.loc18_10, %.loc18_13 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index f6705fa2f6f4..28514f6051a0 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -32,12 +32,13 @@ fn Class.G[addr self: Self*]() -> i32 { library "[[@TEST_NAME]]"; class Class { - // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+6]]:25: error: cannot implicitly convert from `Class` to `type` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+7]]:25: error: cannot implicitly convert from `Class` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: fn F[self: Self]() -> self; // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+3]]:25: note: type `Class` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+4]]:25: note: type `Class` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: fn F[self: Self]() -> self; // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fn F[self: Self]() -> self; } @@ -198,7 +199,7 @@ class Class { // CHECK:STDOUT: %return.param_patt: = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %self.ref: %Class = name_ref self, %self -// CHECK:STDOUT: %.loc11: type = converted %self.ref, [template = ] +// CHECK:STDOUT: %.loc12: type = converted %self.ref, [template = ] // CHECK:STDOUT: %self.param: %Class = value_param runtime_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self: %Class = bind_name self, %self.param diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index 88fb4b494511..d81a614d04fa 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -22,12 +22,13 @@ library "[[@TEST_NAME]]"; class C(a:! i32) {} class D(b:! C(1000)); -// CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE+6]]:15: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] +// CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] // CHECK:STDERR: class D(b:! C(1_000)) {} // CHECK:STDERR: ^~~~~ // CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE-4]]:15: note: comparing with previous declaration here [RedeclParamSyntaxPrevious] // CHECK:STDERR: class D(b:! C(1000)); // CHECK:STDERR: ^~~~ +// CHECK:STDERR: class D(b:! C(1_000)) {} // CHECK:STDOUT: --- int_match.carbon @@ -234,22 +235,22 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %b.loc5_9.1: %C.262 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc5_9.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.generic] { -// CHECK:STDOUT: %b.patt.loc12_9.1: %C.262 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc12_9.2 (constants.%b.patt)] -// CHECK:STDOUT: %b.param_patt: %C.262 = value_param_pattern %b.patt.loc12_9.1, runtime_param [symbolic = %b.patt.loc12_9.2 (constants.%b.patt)] +// CHECK:STDOUT: %b.patt.loc13_9.1: %C.262 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc13_9.2 (constants.%b.patt)] +// CHECK:STDOUT: %b.param_patt: %C.262 = value_param_pattern %b.patt.loc13_9.1, runtime_param [symbolic = %b.patt.loc13_9.2 (constants.%b.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %b.param: %C.262 = value_param runtime_param -// CHECK:STDOUT: %.loc12_20.1: type = splice_block %C [template = constants.%C.262] { +// CHECK:STDOUT: %.loc13_20.1: type = splice_block %C [template = constants.%C.262] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.ff9] // CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] // CHECK:STDOUT: %Convert.bound: = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1000) [template = constants.%int_1000.1b6] -// CHECK:STDOUT: %.loc12_20.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1000.1b6] -// CHECK:STDOUT: %.loc12_20.3: %i32 = converted %int_1000, %.loc12_20.2 [template = constants.%int_1000.1b6] +// CHECK:STDOUT: %.loc13_20.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1000.1b6] +// CHECK:STDOUT: %.loc13_20.3: %i32 = converted %int_1000, %.loc13_20.2 [template = constants.%int_1000.1b6] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.1b6) [template = constants.%C.262] // CHECK:STDOUT: } -// CHECK:STDOUT: %b.loc12_9.1: %C.262 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc12_9.2 (constants.%b)] +// CHECK:STDOUT: %b.loc13_9.1: %C.262 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc13_9.2 (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -272,9 +273,9 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(%b.loc12_9.1: %C.262) { -// CHECK:STDOUT: %b.loc12_9.2: %C.262 = bind_symbolic_name b, 0 [symbolic = %b.loc12_9.2 (constants.%b)] -// CHECK:STDOUT: %b.patt.loc12_9.2: %C.262 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc12_9.2 (constants.%b.patt)] +// CHECK:STDOUT: generic class @.1(%b.loc13_9.1: %C.262) { +// CHECK:STDOUT: %b.loc13_9.2: %C.262 = bind_symbolic_name b, 0 [symbolic = %b.loc13_9.2 (constants.%b)] +// CHECK:STDOUT: %b.patt.loc13_9.2: %C.262 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc13_9.2 (constants.%b.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -300,7 +301,7 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%b) { -// CHECK:STDOUT: %b.loc12_9.2 => constants.%b -// CHECK:STDOUT: %b.patt.loc12_9.2 => constants.%b +// CHECK:STDOUT: %b.loc13_9.2 => constants.%b +// CHECK:STDOUT: %b.patt.loc13_9.2 => constants.%b // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index 4f13bea31895..6974133c91ed 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -90,9 +90,10 @@ class C { package FailModifiers; class C { - // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:3: error: impl without base class [ImplWithoutBase] + // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:3: error: impl without base class [ImplWithoutBase] // CHECK:STDERR: impl fn F(); // CHECK:STDERR: ^~~~~~~~~~~~ + // CHECK:STDERR: impl fn F(); } @@ -555,7 +556,7 @@ class Derived { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} -// CHECK:STDOUT: %.loc9: = vtable () [template = constants.%.f2b] +// CHECK:STDOUT: %.loc10: = vtable () [template = constants.%.f2b] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.vptr [template = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/const/collapse.carbon b/toolchain/check/testdata/const/collapse.carbon index ca252e668789..02738f2f847f 100644 --- a/toolchain/check/testdata/const/collapse.carbon +++ b/toolchain/check/testdata/const/collapse.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/const/collapse.carbon // OK, `const (const i32)` is the same type as `const i32`. -// CHECK:STDERR: collapse.carbon:[[@LINE+3]]:25: warning: `const` applied repeatedly to the same type has no additional effect [RepeatedConst] +// CHECK:STDERR: collapse.carbon:[[@LINE+4]]:25: warning: `const` applied repeatedly to the same type has no additional effect [RepeatedConst] // CHECK:STDERR: fn F(p: const i32**) -> const (const i32)** { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn F(p: const i32**) -> const (const i32)** { return p; } @@ -48,19 +49,19 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: %return.patt: %ptr.3bc = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %ptr.3bc = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc15_38: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_38: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %const.loc15_32: type = const_type %i32 [template = constants.%const] -// CHECK:STDOUT: %const.loc15_25: type = const_type %const [template = constants.%const] -// CHECK:STDOUT: %ptr.loc15_42: type = ptr_type %const [template = constants.%ptr.36b] -// CHECK:STDOUT: %ptr.loc15_43: type = ptr_type %ptr.36b [template = constants.%ptr.3bc] +// CHECK:STDOUT: %int_32.loc16_38: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16_38: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %const.loc16_32: type = const_type %i32 [template = constants.%const] +// CHECK:STDOUT: %const.loc16_25: type = const_type %const [template = constants.%const] +// CHECK:STDOUT: %ptr.loc16_42: type = ptr_type %const [template = constants.%ptr.36b] +// CHECK:STDOUT: %ptr.loc16_43: type = ptr_type %ptr.36b [template = constants.%ptr.3bc] // CHECK:STDOUT: %p.param: %ptr.3bc = value_param runtime_param0 -// CHECK:STDOUT: %.loc15: type = splice_block %ptr.loc15_19 [template = constants.%ptr.3bc] { -// CHECK:STDOUT: %int_32.loc15_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc15_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %const.loc15_9: type = const_type %i32 [template = constants.%const] -// CHECK:STDOUT: %ptr.loc15_18: type = ptr_type %const [template = constants.%ptr.36b] -// CHECK:STDOUT: %ptr.loc15_19: type = ptr_type %ptr.36b [template = constants.%ptr.3bc] +// CHECK:STDOUT: %.loc16: type = splice_block %ptr.loc16_19 [template = constants.%ptr.3bc] { +// CHECK:STDOUT: %int_32.loc16_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc16_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %const.loc16_9: type = const_type %i32 [template = constants.%const] +// CHECK:STDOUT: %ptr.loc16_18: type = ptr_type %const [template = constants.%ptr.36b] +// CHECK:STDOUT: %ptr.loc16_19: type = ptr_type %ptr.36b [template = constants.%ptr.3bc] // CHECK:STDOUT: } // CHECK:STDOUT: %p: %ptr.3bc = bind_name p, %p.param // CHECK:STDOUT: %return.param: ref %ptr.3bc = out_param runtime_param1 diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index 570ab8ca4208..1f0a7f4b4f4e 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -13,12 +13,13 @@ // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn G(p: const (const i32)**) -> i32** { - // CHECK:STDERR: fail_collapse.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `const i32**` to `i32**` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_collapse.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `const i32**` to `i32**` [ImplicitAsConversionFailure] // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_collapse.carbon:[[@LINE+3]]:3: note: type `const i32**` does not implement interface `Core.ImplicitAs(i32**)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_collapse.carbon:[[@LINE+4]]:3: note: type `const i32**` does not implement interface `Core.ImplicitAs(i32**)` [MissingImplInMemberAccessNote] // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: return p; } @@ -79,7 +80,7 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: fn @G(%p.param_patt: %ptr.3bc) -> %ptr.5d5 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.3bc = name_ref p, %p -// CHECK:STDOUT: %.loc22: %ptr.5d5 = converted %p.ref, [template = ] +// CHECK:STDOUT: %.loc23: %ptr.5d5 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index 7e7d8ba21c7d..d81d8a42eba3 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -111,12 +111,13 @@ fn G() -> i32 { // which we can't deduce through. We should decide if we want to support // deductions of that form. If not, it'd be nice to diagnose this situation // better. - // CHECK:STDERR: fail_bound_type_mismatch.carbon:[[@LINE+6]]:10: error: cannot deduce value for generic parameter `N` [DeductionIncomplete] + // CHECK:STDERR: fail_bound_type_mismatch.carbon:[[@LINE+7]]:10: error: cannot deduce value for generic parameter `N` [DeductionIncomplete] // CHECK:STDERR: return F(a); // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_bound_type_mismatch.carbon:[[@LINE-12]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn F[N:! i32](a: [C; N]) -> i32 { return N; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: return F(a); } diff --git a/toolchain/check/testdata/deduce/int_float.carbon b/toolchain/check/testdata/deduce/int_float.carbon index 6732102cd696..58136d7f5a9d 100644 --- a/toolchain/check/testdata/deduce/int_float.carbon +++ b/toolchain/check/testdata/deduce/int_float.carbon @@ -25,9 +25,10 @@ fn G(a: i64) -> Core.IntLiteral() { library "[[@TEST_NAME]]"; // TODO: This should pass once we accept symbolic widths for Core.Float. -// CHECK:STDERR: fail_todo_float.carbon:[[@LINE+3]]:32: error: cannot evaluate type expression [TypeExprEvaluationFailure] +// CHECK:STDERR: fail_todo_float.carbon:[[@LINE+4]]:32: error: cannot evaluate type expression [TypeExprEvaluationFailure] // CHECK:STDERR: fn F[N:! Core.IntLiteral()](n: Core.Float(N)) -> Core.IntLiteral() { // CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: fn F[N:! Core.IntLiteral()](n: Core.Float(N)) -> Core.IntLiteral() { return N; } @@ -207,35 +208,35 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %N.patt.loc8_6.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc8_6.2 (constants.%N.patt)] -// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc8_6.1, runtime_param [symbolic = %N.patt.loc8_6.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.patt.loc9_6.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc9_6.2 (constants.%N.patt)] +// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc9_6.1, runtime_param [symbolic = %N.patt.loc9_6.2 (constants.%N.patt)] // CHECK:STDOUT: %n.patt: = binding_pattern n // CHECK:STDOUT: %n.param_patt: = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %Core.ref.loc8_50: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref.loc8_54: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.72f [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type.loc8_66: init type = call %IntLiteral.ref.loc8_54() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_66.1: type = value_of_initializer %int_literal.make_type.loc8_66 [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_66.2: type = converted %int_literal.make_type.loc8_66, %.loc8_66.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %Core.ref.loc9_50: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %IntLiteral.ref.loc9_54: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.72f [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type.loc9_66: init type = call %IntLiteral.ref.loc9_54() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc9_66.1: type = value_of_initializer %int_literal.make_type.loc9_66 [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc9_66.2: type = converted %int_literal.make_type.loc9_66, %.loc9_66.1 [template = Core.IntLiteral] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param -// CHECK:STDOUT: %.loc8_26.1: type = splice_block %.loc8_26.3 [template = Core.IntLiteral] { -// CHECK:STDOUT: %Core.ref.loc8_10: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref.loc8_14: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.72f [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type.loc8_26: init type = call %IntLiteral.ref.loc8_14() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_26.2: type = value_of_initializer %int_literal.make_type.loc8_26 [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_26.3: type = converted %int_literal.make_type.loc8_26, %.loc8_26.2 [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc9_26.1: type = splice_block %.loc9_26.3 [template = Core.IntLiteral] { +// CHECK:STDOUT: %Core.ref.loc9_10: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %IntLiteral.ref.loc9_14: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.72f [template = constants.%IntLiteral] +// CHECK:STDOUT: %int_literal.make_type.loc9_26: init type = call %IntLiteral.ref.loc9_14() [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc9_26.2: type = value_of_initializer %int_literal.make_type.loc9_26 [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc9_26.3: type = converted %int_literal.make_type.loc9_26, %.loc9_26.2 [template = Core.IntLiteral] // CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc8_6.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc8_6.2 (constants.%N)] +// CHECK:STDOUT: %N.loc9_6.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc9_6.2 (constants.%N)] // CHECK:STDOUT: %n.param: = value_param runtime_param0 // CHECK:STDOUT: %.1: = splice_block [template = ] { -// CHECK:STDOUT: %Core.ref.loc8_32: = name_ref Core, imports.%Core [template = imports.%Core] +// CHECK:STDOUT: %Core.ref.loc9_32: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%import_ref.1d6 [template = constants.%Float] -// CHECK:STDOUT: %N.ref.loc8: Core.IntLiteral = name_ref N, %N.loc8_6.1 [symbolic = %N.loc8_6.2 (constants.%N)] -// CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%N.ref.loc8) -// CHECK:STDOUT: %.loc8_44.1: type = value_of_initializer %float.make_type -// CHECK:STDOUT: %.loc8_44.2: type = converted %float.make_type, %.loc8_44.1 +// CHECK:STDOUT: %N.ref.loc9: Core.IntLiteral = name_ref N, %N.loc9_6.1 [symbolic = %N.loc9_6.2 (constants.%N)] +// CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%N.ref.loc9) +// CHECK:STDOUT: %.loc9_44.1: type = value_of_initializer %float.make_type +// CHECK:STDOUT: %.loc9_44.2: type = converted %float.make_type, %.loc9_44.1 // CHECK:STDOUT: } // CHECK:STDOUT: %n: = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 @@ -250,14 +251,14 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.72f [template = constants.%IntLiteral] // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc12_33.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc12_33.2: type = converted %int_literal.make_type, %.loc12_33.1 [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc13_33.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] +// CHECK:STDOUT: %.loc13_33.2: type = converted %int_literal.make_type, %.loc13_33.1 [template = Core.IntLiteral] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc12_9.1: type = splice_block %.loc12_9.3 [template = f64] { +// CHECK:STDOUT: %.loc13_9.1: type = splice_block %.loc13_9.3 [template = f64] { // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] -// CHECK:STDOUT: %.loc12_9.2: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc12_9.3: type = converted %float.make_type, %.loc12_9.2 [template = f64] +// CHECK:STDOUT: %.loc13_9.2: type = value_of_initializer %float.make_type [template = f64] +// CHECK:STDOUT: %.loc13_9.3: type = converted %float.make_type, %.loc13_9.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 @@ -265,16 +266,16 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%N.loc8_6.1: Core.IntLiteral) { -// CHECK:STDOUT: %N.loc8_6.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc8_6.2 (constants.%N)] -// CHECK:STDOUT: %N.patt.loc8_6.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc8_6.2 (constants.%N.patt)] +// CHECK:STDOUT: generic fn @F(%N.loc9_6.1: Core.IntLiteral) { +// CHECK:STDOUT: %N.loc9_6.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc9_6.2 (constants.%N)] +// CHECK:STDOUT: %N.patt.loc9_6.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc9_6.2 (constants.%N.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%n.param_patt: ) -> Core.IntLiteral { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc9: Core.IntLiteral = name_ref N, %N.loc8_6.1 [symbolic = %N.loc8_6.2 (constants.%N)] -// CHECK:STDOUT: return %N.ref.loc9 +// CHECK:STDOUT: %N.ref.loc10: Core.IntLiteral = name_ref N, %N.loc9_6.1 [symbolic = %N.loc9_6.2 (constants.%N)] +// CHECK:STDOUT: return %N.ref.loc10 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -286,7 +287,7 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { -// CHECK:STDOUT: %N.loc8_6.2 => constants.%N -// CHECK:STDOUT: %N.patt.loc8_6.2 => constants.%N +// CHECK:STDOUT: %N.loc9_6.2 => constants.%N +// CHECK:STDOUT: %N.patt.loc9_6.2 => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index 141b01498b12..650c883d7d0d 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -43,12 +43,13 @@ class D {} fn F[T:! type](pair: (T, T)) -> T; fn G(pair: (C, D)) -> D { - // CHECK:STDERR: fail_inconsistent.carbon:[[@LINE+6]]:10: error: inconsistent deductions for value of generic parameter `T` [DeductionInconsistent] + // CHECK:STDERR: fail_inconsistent.carbon:[[@LINE+7]]:10: error: inconsistent deductions for value of generic parameter `T` [DeductionInconsistent] // CHECK:STDERR: return F(pair); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_inconsistent.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn F[T:! type](pair: (T, T)) -> T; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: return F(pair); } diff --git a/toolchain/check/testdata/deduce/type_operator.carbon b/toolchain/check/testdata/deduce/type_operator.carbon index daf849623f8b..eae445e3a04d 100644 --- a/toolchain/check/testdata/deduce/type_operator.carbon +++ b/toolchain/check/testdata/deduce/type_operator.carbon @@ -53,12 +53,13 @@ class C {} fn F[T:! type](p: const T*) -> T { return F(p); } fn G(p: C*) -> const C { - // CHECK:STDERR: fail_const_from_nonconst.carbon:[[@LINE+6]]:10: error: cannot deduce value for generic parameter `T` [DeductionIncomplete] + // CHECK:STDERR: fail_const_from_nonconst.carbon:[[@LINE+7]]:10: error: cannot deduce value for generic parameter `T` [DeductionIncomplete] // CHECK:STDERR: return F(p); // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_const_from_nonconst.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn F[T:! type](p: const T*) -> T { return F(p); } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: return F(p); } diff --git a/toolchain/check/testdata/eval/fail_aggregate.carbon b/toolchain/check/testdata/eval/fail_aggregate.carbon index 34c7881d2927..00b0158ac442 100644 --- a/toolchain/check/testdata/eval/fail_aggregate.carbon +++ b/toolchain/check/testdata/eval/fail_aggregate.carbon @@ -10,9 +10,10 @@ // TODO: This creates an array temporary, which we don't yet support evaluating. -// CHECK:STDERR: fail_aggregate.carbon:[[@LINE+3]]:43: error: array bound is not a constant [InvalidArrayExpr] +// CHECK:STDERR: fail_aggregate.carbon:[[@LINE+4]]:43: error: array bound is not a constant [InvalidArrayExpr] // CHECK:STDERR: var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: --- fail_aggregate.carbon @@ -75,66 +76,66 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_0.loc16_30: Core.IntLiteral = int_value 0 [template = constants.%int_0] -// CHECK:STDOUT: %.loc16_32: %tuple.type.985 = tuple_literal (%int_0.loc16_30) -// CHECK:STDOUT: %int_32.loc16_38: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_38: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_0.loc17_30: Core.IntLiteral = int_value 0 [template = constants.%int_0] +// CHECK:STDOUT: %.loc17_32: %tuple.type.985 = tuple_literal (%int_0.loc17_30) +// CHECK:STDOUT: %int_32.loc17_38: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc17_38: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5.64b] // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7.29f] -// CHECK:STDOUT: %int_1.loc16_51: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] +// CHECK:STDOUT: %int_1.loc17_51: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9.988] -// CHECK:STDOUT: %.loc16_55.1: %tuple.type.d46 = tuple_literal (%int_5, %int_7, %int_1.loc16_51, %int_9) -// CHECK:STDOUT: %int_32.loc16_61: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_61: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc17_55.1: %tuple.type.d46 = tuple_literal (%int_5, %int_7, %int_1.loc17_51, %int_9) +// CHECK:STDOUT: %int_32.loc17_61: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc17_61: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4] // CHECK:STDOUT: %array_type: type = array_type %int_4, %i32 [template = constants.%array_type.f32] -// CHECK:STDOUT: %impl.elem0.loc16_55.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16_55.1: = bound_method %int_5, %impl.elem0.loc16_55.1 [template = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %Convert.specific_fn.loc16_55.1: = specific_function %Convert.bound.loc16_55.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] -// CHECK:STDOUT: %int.convert_checked.loc16_55.1: init %i32 = call %Convert.specific_fn.loc16_55.1(%int_5) [template = constants.%int_5.0f6] -// CHECK:STDOUT: %.loc16_55.2: init %i32 = converted %int_5, %int.convert_checked.loc16_55.1 [template = constants.%int_5.0f6] -// CHECK:STDOUT: %.loc16_55.3: ref %array_type.f32 = temporary_storage -// CHECK:STDOUT: %int_0.loc16_55: Core.IntLiteral = int_value 0 [template = constants.%int_0] -// CHECK:STDOUT: %.loc16_55.4: ref %i32 = array_index %.loc16_55.3, %int_0.loc16_55 -// CHECK:STDOUT: %.loc16_55.5: init %i32 = initialize_from %.loc16_55.2 to %.loc16_55.4 [template = constants.%int_5.0f6] -// CHECK:STDOUT: %impl.elem0.loc16_55.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16_55.2: = bound_method %int_7, %impl.elem0.loc16_55.2 [template = constants.%Convert.bound.208] -// CHECK:STDOUT: %Convert.specific_fn.loc16_55.2: = specific_function %Convert.bound.loc16_55.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c12] -// CHECK:STDOUT: %int.convert_checked.loc16_55.2: init %i32 = call %Convert.specific_fn.loc16_55.2(%int_7) [template = constants.%int_7.0b1] -// CHECK:STDOUT: %.loc16_55.6: init %i32 = converted %int_7, %int.convert_checked.loc16_55.2 [template = constants.%int_7.0b1] -// CHECK:STDOUT: %int_1.loc16_55: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc16_55.7: ref %i32 = array_index %.loc16_55.3, %int_1.loc16_55 -// CHECK:STDOUT: %.loc16_55.8: init %i32 = initialize_from %.loc16_55.6 to %.loc16_55.7 [template = constants.%int_7.0b1] -// CHECK:STDOUT: %impl.elem0.loc16_55.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16_55.3: = bound_method %int_1.loc16_51, %impl.elem0.loc16_55.3 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc16_55.3: = specific_function %Convert.bound.loc16_55.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc16_55.3: init %i32 = call %Convert.specific_fn.loc16_55.3(%int_1.loc16_51) [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc16_55.9: init %i32 = converted %int_1.loc16_51, %int.convert_checked.loc16_55.3 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %int_2.loc16_55: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc16_55.10: ref %i32 = array_index %.loc16_55.3, %int_2.loc16_55 -// CHECK:STDOUT: %.loc16_55.11: init %i32 = initialize_from %.loc16_55.9 to %.loc16_55.10 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc16_55.4: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16_55.4: = bound_method %int_9, %impl.elem0.loc16_55.4 [template = constants.%Convert.bound.9e2] -// CHECK:STDOUT: %Convert.specific_fn.loc16_55.4: = specific_function %Convert.bound.loc16_55.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b02] -// CHECK:STDOUT: %int.convert_checked.loc16_55.4: init %i32 = call %Convert.specific_fn.loc16_55.4(%int_9) [template = constants.%int_9.f88] -// CHECK:STDOUT: %.loc16_55.12: init %i32 = converted %int_9, %int.convert_checked.loc16_55.4 [template = constants.%int_9.f88] +// CHECK:STDOUT: %impl.elem0.loc17_55.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc17_55.1: = bound_method %int_5, %impl.elem0.loc17_55.1 [template = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %Convert.specific_fn.loc17_55.1: = specific_function %Convert.bound.loc17_55.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.ba9] +// CHECK:STDOUT: %int.convert_checked.loc17_55.1: init %i32 = call %Convert.specific_fn.loc17_55.1(%int_5) [template = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc17_55.2: init %i32 = converted %int_5, %int.convert_checked.loc17_55.1 [template = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc17_55.3: ref %array_type.f32 = temporary_storage +// CHECK:STDOUT: %int_0.loc17_55: Core.IntLiteral = int_value 0 [template = constants.%int_0] +// CHECK:STDOUT: %.loc17_55.4: ref %i32 = array_index %.loc17_55.3, %int_0.loc17_55 +// CHECK:STDOUT: %.loc17_55.5: init %i32 = initialize_from %.loc17_55.2 to %.loc17_55.4 [template = constants.%int_5.0f6] +// CHECK:STDOUT: %impl.elem0.loc17_55.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc17_55.2: = bound_method %int_7, %impl.elem0.loc17_55.2 [template = constants.%Convert.bound.208] +// CHECK:STDOUT: %Convert.specific_fn.loc17_55.2: = specific_function %Convert.bound.loc17_55.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c12] +// CHECK:STDOUT: %int.convert_checked.loc17_55.2: init %i32 = call %Convert.specific_fn.loc17_55.2(%int_7) [template = constants.%int_7.0b1] +// CHECK:STDOUT: %.loc17_55.6: init %i32 = converted %int_7, %int.convert_checked.loc17_55.2 [template = constants.%int_7.0b1] +// CHECK:STDOUT: %int_1.loc17_55: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc17_55.7: ref %i32 = array_index %.loc17_55.3, %int_1.loc17_55 +// CHECK:STDOUT: %.loc17_55.8: init %i32 = initialize_from %.loc17_55.6 to %.loc17_55.7 [template = constants.%int_7.0b1] +// CHECK:STDOUT: %impl.elem0.loc17_55.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc17_55.3: = bound_method %int_1.loc17_51, %impl.elem0.loc17_55.3 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %Convert.specific_fn.loc17_55.3: = specific_function %Convert.bound.loc17_55.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc17_55.3: init %i32 = call %Convert.specific_fn.loc17_55.3(%int_1.loc17_51) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc17_55.9: init %i32 = converted %int_1.loc17_51, %int.convert_checked.loc17_55.3 [template = constants.%int_1.5d2] +// CHECK:STDOUT: %int_2.loc17_55: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] +// CHECK:STDOUT: %.loc17_55.10: ref %i32 = array_index %.loc17_55.3, %int_2.loc17_55 +// CHECK:STDOUT: %.loc17_55.11: init %i32 = initialize_from %.loc17_55.9 to %.loc17_55.10 [template = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc17_55.4: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc17_55.4: = bound_method %int_9, %impl.elem0.loc17_55.4 [template = constants.%Convert.bound.9e2] +// CHECK:STDOUT: %Convert.specific_fn.loc17_55.4: = specific_function %Convert.bound.loc17_55.4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b02] +// CHECK:STDOUT: %int.convert_checked.loc17_55.4: init %i32 = call %Convert.specific_fn.loc17_55.4(%int_9) [template = constants.%int_9.f88] +// CHECK:STDOUT: %.loc17_55.12: init %i32 = converted %int_9, %int.convert_checked.loc17_55.4 [template = constants.%int_9.f88] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %.loc16_55.13: ref %i32 = array_index %.loc16_55.3, %int_3 -// CHECK:STDOUT: %.loc16_55.14: init %i32 = initialize_from %.loc16_55.12 to %.loc16_55.13 [template = constants.%int_9.f88] -// CHECK:STDOUT: %.loc16_55.15: init %array_type.f32 = array_init (%.loc16_55.5, %.loc16_55.8, %.loc16_55.11, %.loc16_55.14) to %.loc16_55.3 [template = constants.%array] -// CHECK:STDOUT: %.loc16_57.1: init %array_type.f32 = converted %.loc16_55.1, %.loc16_55.15 [template = constants.%array] -// CHECK:STDOUT: %int_2.loc16_70: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc16_57.2: ref %array_type.f32 = temporary %.loc16_55.3, %.loc16_57.1 -// CHECK:STDOUT: %int_32.loc16_71: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_71: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc16_70: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc16_70: = bound_method %int_2.loc16_70, %impl.elem0.loc16_70 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc16_70: = specific_function %Convert.bound.loc16_70, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc16_70: init %i32 = call %Convert.specific_fn.loc16_70(%int_2.loc16_70) [template = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc16_70.1: %i32 = value_of_initializer %int.convert_checked.loc16_70 [template = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc16_70.2: %i32 = converted %int_2.loc16_70, %.loc16_70.1 [template = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc16_71.1: ref %i32 = array_index %.loc16_57.2, %.loc16_70.2 -// CHECK:STDOUT: %.loc16_71.2: %i32 = bind_value %.loc16_71.1 +// CHECK:STDOUT: %.loc17_55.13: ref %i32 = array_index %.loc17_55.3, %int_3 +// CHECK:STDOUT: %.loc17_55.14: init %i32 = initialize_from %.loc17_55.12 to %.loc17_55.13 [template = constants.%int_9.f88] +// CHECK:STDOUT: %.loc17_55.15: init %array_type.f32 = array_init (%.loc17_55.5, %.loc17_55.8, %.loc17_55.11, %.loc17_55.14) to %.loc17_55.3 [template = constants.%array] +// CHECK:STDOUT: %.loc17_57.1: init %array_type.f32 = converted %.loc17_55.1, %.loc17_55.15 [template = constants.%array] +// CHECK:STDOUT: %int_2.loc17_70: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] +// CHECK:STDOUT: %.loc17_57.2: ref %array_type.f32 = temporary %.loc17_55.3, %.loc17_57.1 +// CHECK:STDOUT: %int_32.loc17_71: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc17_71: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc17_70: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc17_70: = bound_method %int_2.loc17_70, %impl.elem0.loc17_70 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %Convert.specific_fn.loc17_70: = specific_function %Convert.bound.loc17_70, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc17_70: init %i32 = call %Convert.specific_fn.loc17_70(%int_2.loc17_70) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc17_70.1: %i32 = value_of_initializer %int.convert_checked.loc17_70 [template = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc17_70.2: %i32 = converted %int_2.loc17_70, %.loc17_70.1 [template = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc17_71.1: ref %i32 = array_index %.loc17_57.2, %.loc17_70.2 +// CHECK:STDOUT: %.loc17_71.2: %i32 = bind_value %.loc17_71.1 // CHECK:STDOUT: assign file.%array_index.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/builtin/fail_redefined.carbon b/toolchain/check/testdata/function/builtin/fail_redefined.carbon index e53e0362dbae..516b14301500 100644 --- a/toolchain/check/testdata/function/builtin/fail_redefined.carbon +++ b/toolchain/check/testdata/function/builtin/fail_redefined.carbon @@ -29,12 +29,13 @@ fn B(n: i32, m: i32) -> i32 { return n; } fn B(n: i32, m: i32) -> i32 = "int.sadd"; fn C(n: i32, m: i32) -> i32 = "int.sadd"; -// CHECK:STDERR: fail_redefined.carbon:[[@LINE+6]]:1: error: redefinition of `fn C` [RedeclRedef] +// CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: error: redefinition of `fn C` [RedeclRedef] // CHECK:STDERR: fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note: previously defined here [RedeclPrevDef] // CHECK:STDERR: fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: --- fail_redefined.carbon @@ -197,7 +198,7 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl.loc38: %.type.b6a92a.3 = fn_decl @.3 [template = constants.%.d852be.3] { +// CHECK:STDOUT: %.decl.loc39: %.type.b6a92a.3 = fn_decl @.3 [template = constants.%.d852be.3] { // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: %m.patt: %i32 = binding_pattern m @@ -205,18 +206,18 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc38_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc38_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc39_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc39_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc38_9: type = splice_block %i32.loc38_9 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc38_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc38_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc39_9: type = splice_block %i32.loc39_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc39_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc39_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %m.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc38_17: type = splice_block %i32.loc38_17 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc38_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc38_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc39_17: type = splice_block %i32.loc39_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc39_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc39_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %m: %i32 = bind_name m, %m.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 diff --git a/toolchain/check/testdata/function/builtin/fail_unknown.carbon b/toolchain/check/testdata/function/builtin/fail_unknown.carbon index 8d26be2113ac..8fca7b19baf7 100644 --- a/toolchain/check/testdata/function/builtin/fail_unknown.carbon +++ b/toolchain/check/testdata/function/builtin/fail_unknown.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/fail_unknown.carbon -// CHECK:STDERR: fail_unknown.carbon:[[@LINE+3]]:23: error: unknown builtin function name "unknown.builtin.name" [UnknownBuiltinFunctionName] +// CHECK:STDERR: fail_unknown.carbon:[[@LINE+4]]:23: error: unknown builtin function name "unknown.builtin.name" [UnknownBuiltinFunctionName] // CHECK:STDERR: fn UnknownBuiltin() = "unknown.builtin.name"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn UnknownBuiltin() = "unknown.builtin.name"; // CHECK:STDOUT: --- fail_unknown.carbon diff --git a/toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon b/toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon index ddc67eb19309..0dbc955f4d2d 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon @@ -40,9 +40,10 @@ class MyIntLiteral { adapt {}; } -// CHECK:STDERR: fail_bad_adapt.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "int.make_type_signed" [InvalidBuiltinSignature] +// CHECK:STDERR: fail_bad_adapt.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.make_type_signed" [InvalidBuiltinSignature] // CHECK:STDERR: fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: --- adapt.carbon diff --git a/toolchain/check/testdata/function/call/fail_not_callable.carbon b/toolchain/check/testdata/function/call/fail_not_callable.carbon index df79412f46cb..48cf89e29cca 100644 --- a/toolchain/check/testdata/function/call/fail_not_callable.carbon +++ b/toolchain/check/testdata/function/call/fail_not_callable.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/fail_not_callable.carbon fn Run() { - // CHECK:STDERR: fail_not_callable.carbon:[[@LINE+3]]:16: error: value of type `String` is not callable [CallToNonCallable] + // CHECK:STDERR: fail_not_callable.carbon:[[@LINE+4]]:16: error: value of type `String` is not callable [CallToNonCallable] // CHECK:STDERR: var x: i32 = "hello"(); // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: var x: i32 = "hello"(); } diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index ed88ec5c01f1..24f096da6fcb 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -55,12 +55,13 @@ fn Main() { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Run2(); - // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:3: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch] + // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch] // CHECK:STDERR: Run2(0); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_param_count.carbon:[[@LINE-48]]:1: note: calling function declared here [InCallToEntity] // CHECK:STDERR: fn Run2(a: i32, b: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: Run2(0); } @@ -159,8 +160,8 @@ fn Main() { // CHECK:STDOUT: %int_0.loc48: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: %int_1.loc48: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: %Run2.ref.loc57: %Run2.type = name_ref Run2, file.%Run2.decl [template = constants.%Run2] -// CHECK:STDOUT: %Run2.ref.loc64: %Run2.type = name_ref Run2, file.%Run2.decl [template = constants.%Run2] -// CHECK:STDOUT: %int_0.loc64: Core.IntLiteral = int_value 0 [template = constants.%int_0] +// CHECK:STDOUT: %Run2.ref.loc65: %Run2.type = name_ref Run2, file.%Run2.decl [template = constants.%Run2] +// CHECK:STDOUT: %int_0.loc65: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index 6eb2c15fd993..397cb7bb69ec 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -11,15 +11,16 @@ fn G(a: i32) {} fn F() { - // CHECK:STDERR: fail_param_type.carbon:[[@LINE+9]]:5: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_param_type.carbon:[[@LINE+10]]:5: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: G(1.0); // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:5: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_param_type.carbon:[[@LINE+7]]:5: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: G(1.0); // CHECK:STDERR: ^~~ // CHECK:STDERR: fail_param_type.carbon:[[@LINE-9]]:6: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: fn G(a: i32) {} // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: G(1.0); } @@ -75,7 +76,7 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [template = constants.%G] // CHECK:STDOUT: %float: f64 = float_literal 1 [template = constants.%float] -// CHECK:STDOUT: %.loc23: %i32 = converted %float, [template = ] +// CHECK:STDOUT: %.loc24: %i32 = converted %float, [template = ] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon index 61bc2bde3e25..cafdeefba49d 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -11,12 +11,13 @@ fn Foo() -> f64 { return 1.0; } fn Run() { - // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: i32 = Foo(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+4]]:3: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: i32 = Foo(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: var x: i32 = Foo(); } @@ -78,7 +79,7 @@ fn Run() { // CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var // CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo] // CHECK:STDOUT: %Foo.call: init f64 = call %Foo.ref() -// CHECK:STDOUT: %.loc20: %i32 = converted %Foo.call, [template = ] +// CHECK:STDOUT: %.loc21: %i32 = converted %Foo.call, [template = ] // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon b/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon index c2c120546314..5f378409c561 100644 --- a/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon -// CHECK:STDERR: fail_explicit_self_param.carbon:[[@LINE+3]]:6: error: `self` can only be declared in an implicit parameter list [SelfOutsideImplicitParamList] +// CHECK:STDERR: fail_explicit_self_param.carbon:[[@LINE+4]]:6: error: `self` can only be declared in an implicit parameter list [SelfOutsideImplicitParamList] // CHECK:STDERR: fn F(self: ()); // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: fn F(self: ()); fn Run() { @@ -38,9 +39,9 @@ fn Run() { // CHECK:STDOUT: %self.param_patt: %empty_tuple.type = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param runtime_param0 -// CHECK:STDOUT: %.loc14_13.1: type = splice_block %.loc14_13.3 [template = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc14_13.2: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc14_13.3: type = converted %.loc14_13.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc15_13.1: type = splice_block %.loc15_13.3 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc15_13.2: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc15_13.3: type = converted %.loc15_13.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param // CHECK:STDOUT: } @@ -52,10 +53,10 @@ fn Run() { // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc17_6.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc18_6.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc17_6.2: %empty_tuple.type = converted %.loc17_6.1, %empty_tuple [template = constants.%empty_tuple] -// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref(%.loc17_6.2) +// CHECK:STDOUT: %.loc18_6.2: %empty_tuple.type = converted %.loc18_6.1, %empty_tuple [template = constants.%empty_tuple] +// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref(%.loc18_6.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon b/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon index 9cce73b8d801..0c4dc22e72c8 100644 --- a/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon -// CHECK:STDERR: fail_runtime_implicit_param.carbon:[[@LINE+3]]:6: error: implicit parameters of functions must be constant or `self` [ImplictParamMustBeConstant] +// CHECK:STDERR: fail_runtime_implicit_param.carbon:[[@LINE+4]]:6: error: implicit parameters of functions must be constant or `self` [ImplictParamMustBeConstant] // CHECK:STDERR: fn F[s: ()](); // CHECK:STDERR: ^~~~~ +// CHECK:STDERR: fn F[s: ()](); fn Run() { diff --git a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon index b2c43edd3599..f0f0ba451c55 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_param_in_type.carbon -// CHECK:STDERR: fail_param_in_type.carbon:[[@LINE+3]]:23: error: array bound is not a constant [InvalidArrayExpr] +// CHECK:STDERR: fail_param_in_type.carbon:[[@LINE+4]]:23: error: array bound is not a constant [InvalidArrayExpr] // CHECK:STDERR: fn F(n: i32, a: [i32; n]*); // CHECK:STDERR: ^ +// CHECK:STDERR: fn F(n: i32, a: [i32; n]*); // CHECK:STDOUT: --- fail_param_in_type.carbon @@ -43,15 +44,15 @@ fn F(n: i32, a: [i32; n]*); // CHECK:STDOUT: %a.param_patt: = value_param_pattern %a.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc14_9: type = splice_block %i32.loc14_9 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc14_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_9: type = splice_block %i32.loc15_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc15_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param // CHECK:STDOUT: %a.param: = value_param runtime_param1 -// CHECK:STDOUT: %.loc14_25: type = splice_block %ptr [template = ] { -// CHECK:STDOUT: %int_32.loc14_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc14_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc15_25: type = splice_block %ptr [template = ] { +// CHECK:STDOUT: %int_32.loc15_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n // CHECK:STDOUT: %ptr: type = ptr_type [template = ] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon index 1b58c053becb..bb46c2aed642 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon @@ -8,12 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_param_redecl.carbon -// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+6]]:14: error: duplicate name being declared in the same scope [NameDeclDuplicate] +// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+7]]:14: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: fn F(n: i32, n: i32); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+3]]:6: note: name is previously declared here [NameDeclPrevious] +// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+4]]:6: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: fn F(n: i32, n: i32); // CHECK:STDERR: ^ +// CHECK:STDERR: fn F(n: i32, n: i32); // CHECK:STDOUT: --- fail_param_redecl.carbon @@ -40,25 +41,25 @@ fn F(n: i32, n: i32); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %n.patt.loc17_6: %i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt.loc17_7: %i32 = value_param_pattern %n.patt.loc17_6, runtime_param0 -// CHECK:STDOUT: %n.patt.loc17_14: %i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt.loc17_15: %i32 = value_param_pattern %n.patt.loc17_14, runtime_param1 +// CHECK:STDOUT: %n.patt.loc18_6: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt.loc18_7: %i32 = value_param_pattern %n.patt.loc18_6, runtime_param0 +// CHECK:STDOUT: %n.patt.loc18_14: %i32 = binding_pattern n +// CHECK:STDOUT: %n.param_patt.loc18_15: %i32 = value_param_pattern %n.patt.loc18_14, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %n.param.loc17_7: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc17_9: type = splice_block %i32.loc17_9 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc17_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %n.param.loc18_7: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc18_9: type = splice_block %i32.loc18_9 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc18_9: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %n.loc17_6: %i32 = bind_name n, %n.param.loc17_7 -// CHECK:STDOUT: %n.param.loc17_15: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc17_17: type = splice_block %i32.loc17_17 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc17_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc17_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %n.loc18_6: %i32 = bind_name n, %n.param.loc18_7 +// CHECK:STDOUT: %n.param.loc18_15: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc18_17: type = splice_block %i32.loc18_17 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc18_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc18_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } -// CHECK:STDOUT: %n.loc17_14: %i32 = bind_name n, %n.param.loc17_15 +// CHECK:STDOUT: %n.loc18_14: %i32 = bind_name n, %n.param.loc18_15 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n.param_patt.loc17_7: %i32, %n.param_patt.loc17_15: %i32); +// CHECK:STDOUT: fn @F(%n.param_patt.loc18_7: %i32, %n.param_patt.loc18_15: %i32); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index e547d25a2a51..b8c2357d126a 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -190,50 +190,51 @@ var e: () = NS.E(); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+44]]:1: in import [InImport] +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+45]]:1: in import [InImport] // CHECK:STDERR: api.carbon:4:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+40]]:1: in import [InImport] +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+41]]:1: in import [InImport] // CHECK:STDERR: extern_api.carbon:4:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: extern library "redecl_extern_api" fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+35]]:1: in import [InImport] +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+36]]:1: in import [InImport] // CHECK:STDERR: api.carbon:5:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+31]]:1: in import [InImport] +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+32]]:1: in import [InImport] // CHECK:STDERR: extern_api.carbon:5:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: extern library "redecl_extern_api" fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+26]]:1: in import [InImport] +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+27]]:1: in import [InImport] // CHECK:STDERR: api.carbon:6:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+22]]:1: in import [InImport] +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+23]]:1: in import [InImport] // CHECK:STDERR: extern_api.carbon:6:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: extern library "redecl_extern_api" fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+17]]:1: in import [InImport] +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+18]]:1: in import [InImport] // CHECK:STDERR: api.carbon:7:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+13]]:1: in import [InImport] +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+14]]:1: in import [InImport] // CHECK:STDERR: extern_api.carbon:7:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: extern library "redecl_extern_api" fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+8]]:1: in import [InImport] +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+9]]:1: in import [InImport] // CHECK:STDERR: api.carbon:10:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+4]]:1: in import [InImport] +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+5]]:1: in import [InImport] // CHECK:STDERR: extern_api.carbon:10:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: extern library "redecl_extern_api" fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: import library "extern_api"; import library "api"; @@ -1081,27 +1082,27 @@ import library "extern_api"; // CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.54c [template = constants.%B] -// CHECK:STDOUT: %int_1.loc52: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc52: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc52: = bound_method %int_1.loc52, %impl.elem0.loc52 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn.loc52: = specific_function %Convert.bound.loc52, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc52: init %i32 = call %Convert.specific_fn.loc52(%int_1.loc52) [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc52_16.1: %i32 = value_of_initializer %int.convert_checked.loc52 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc52_16.2: %i32 = converted %int_1.loc52, %.loc52_16.1 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc52_16.2) -// CHECK:STDOUT: assign file.%b.var, %B.call -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.94c0 [template = constants.%C] // CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc53_25.1: %tuple.type.985 = tuple_literal (%int_1.loc53) // CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] // CHECK:STDOUT: %Convert.bound.loc53: = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn.loc53: = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc53_25.2: %i32 = value_of_initializer %int.convert_checked.loc53 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc53_25.3: %i32 = converted %int_1.loc53, %.loc53_25.2 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc53_25.3) [template = constants.%tuple] -// CHECK:STDOUT: %.loc53_25.4: %tuple.type.a1c = converted %.loc53_25.1, %tuple [template = constants.%tuple] -// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc53_25.4) +// CHECK:STDOUT: %.loc53_16.1: %i32 = value_of_initializer %int.convert_checked.loc53 [template = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc53_16.2: %i32 = converted %int_1.loc53, %.loc53_16.1 [template = constants.%int_1.5d2] +// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.2) +// CHECK:STDOUT: assign file.%b.var, %B.call +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.94c0 [template = constants.%C] +// CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc54_25.1: %tuple.type.985 = tuple_literal (%int_1.loc54) +// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc54: = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound] +// CHECK:STDOUT: %Convert.specific_fn.loc54: = specific_function %Convert.bound.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %Convert.specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc54_25.2: %i32 = value_of_initializer %int.convert_checked.loc54 [template = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc54_25.3: %i32 = converted %int_1.loc54, %.loc54_25.2 [template = constants.%int_1.5d2] +// CHECK:STDOUT: %tuple: %tuple.type.a1c = tuple_value (%.loc54_25.3) [template = constants.%tuple] +// CHECK:STDOUT: %.loc54_25.4: %tuple.type.a1c = converted %.loc54_25.1, %tuple [template = constants.%tuple] +// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc54_25.4) // CHECK:STDOUT: assign file.%c.var, %C.call // CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.5f5 [template = constants.%D] // CHECK:STDOUT: %D.call: init %empty_tuple.type = call %D.ref() diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon index f212ba75598b..f48ad0f42ae0 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon @@ -71,13 +71,14 @@ library "[[@TEST_NAME]]"; import library "basic"; -// CHECK:STDERR: fail_extern_library_in_importer.carbon:[[@LINE+7]]:1: error: cannot declare imported `fn F` as `extern library` [ExternLibraryInImporter] +// CHECK:STDERR: fail_extern_library_in_importer.carbon:[[@LINE+8]]:1: error: cannot declare imported `fn F` as `extern library` [ExternLibraryInImporter] // CHECK:STDERR: extern library "basic" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_extern_library_in_importer.carbon:[[@LINE-5]]:1: in import [InImport] // CHECK:STDERR: basic.carbon:4:1: note: previously declared here [RedeclPrevDecl] // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ +// CHECK:STDERR: extern library "basic" fn F(); // CHECK:STDOUT: --- basic.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon index 3557e6fc36d0..bff87d6c4bae 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon @@ -150,9 +150,10 @@ extern library "extern_of_import" fn F(); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_library_on_definition.carbon:[[@LINE+3]]:1: error: a library cannot be provided for an `extern` modifier on a definition [ExternLibraryOnDefinition] +// CHECK:STDERR: fail_extern_library_on_definition.carbon:[[@LINE+4]]:1: error: a library cannot be provided for an `extern` modifier on a definition [ExternLibraryOnDefinition] // CHECK:STDERR: extern library "extern_library_owner" fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: extern library "extern_library_owner" fn F() {} // CHECK:STDOUT: --- extern_library.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon index bc5efcdf4f94..b99111e6370e 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon @@ -28,13 +28,14 @@ package Foo library "[[@TEST_NAME]]"; import library default; -// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+7]]:1: error: declaration in library "wrong_library" doesn't match `extern library` declaration [ExternLibraryIncorrect] +// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+8]]:1: error: declaration in library "wrong_library" doesn't match `extern library` declaration [ExternLibraryIncorrect] // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_wrong_library.carbon:[[@LINE-5]]:1: in import [InImport] // CHECK:STDERR: default.carbon:4:1: note: previously declared with `extern library` here [ExternLibraryExpected] // CHECK:STDERR: extern library "expected" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: extern fn F(); // CHECK:STDOUT: --- default.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon index d1d53cba42a3..720aa311d84d 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon @@ -26,13 +26,14 @@ library "[[@TEST_NAME]]"; import library "extern_library"; -// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+7]]:1: error: declaration in library "wrong_library" doesn't match `extern library` declaration [ExternLibraryIncorrect] +// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+8]]:1: error: declaration in library "wrong_library" doesn't match `extern library` declaration [ExternLibraryIncorrect] // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_wrong_library.carbon:[[@LINE-5]]:1: in import [InImport] // CHECK:STDERR: extern_library.carbon:4:1: note: previously declared with `extern library` here [ExternLibraryExpected] // CHECK:STDERR: extern library default fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: extern fn F(); // CHECK:STDOUT: --- extern_library.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon index 3545f1709313..07c075df466e 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon @@ -67,7 +67,7 @@ fn CallFAndGIncomplete() { // CHECK:STDERR: ^~~~ // CHECK:STDERR: ReturnCUnused(); - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+11]]:3: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType] + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+12]]:3: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: ReturnCUsed(); // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-19]]:1: in import [InImport] @@ -78,6 +78,7 @@ fn CallFAndGIncomplete() { // CHECK:STDERR: fail_incomplete_return.carbon:8:18: note: return type declared here [IncompleteReturnTypeHere] // CHECK:STDERR: fn ReturnCUsed() -> C; // CHECK:STDERR: ^~~~ + // CHECK:STDERR: ReturnCUsed(); ReturnDUnused(); ReturnDUsed(); @@ -232,13 +233,13 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: %ReturnCUsed.ref: %ReturnCUsed.type = name_ref ReturnCUsed, imports.%import_ref.073 [template = constants.%ReturnCUsed] // CHECK:STDOUT: %ReturnCUsed.call: init = call %ReturnCUsed.ref() // CHECK:STDOUT: %ReturnDUnused.ref: %ReturnDUnused.type = name_ref ReturnDUnused, imports.%import_ref.c58 [template = constants.%ReturnDUnused] -// CHECK:STDOUT: %.loc32_17.1: ref %D = temporary_storage -// CHECK:STDOUT: %ReturnDUnused.call: init %D = call %ReturnDUnused.ref() to %.loc32_17.1 -// CHECK:STDOUT: %.loc32_17.2: ref %D = temporary %.loc32_17.1, %ReturnDUnused.call +// CHECK:STDOUT: %.loc33_17.1: ref %D = temporary_storage +// CHECK:STDOUT: %ReturnDUnused.call: init %D = call %ReturnDUnused.ref() to %.loc33_17.1 +// CHECK:STDOUT: %.loc33_17.2: ref %D = temporary %.loc33_17.1, %ReturnDUnused.call // CHECK:STDOUT: %ReturnDUsed.ref: %ReturnDUsed.type = name_ref ReturnDUsed, imports.%import_ref.e1f [template = constants.%ReturnDUsed] -// CHECK:STDOUT: %.loc33_15.1: ref %D = temporary_storage -// CHECK:STDOUT: %ReturnDUsed.call: init %D = call %ReturnDUsed.ref() to %.loc33_15.1 -// CHECK:STDOUT: %.loc33_15.2: ref %D = temporary %.loc33_15.1, %ReturnDUsed.call +// CHECK:STDOUT: %.loc34_15.1: ref %D = temporary_storage +// CHECK:STDOUT: %ReturnDUsed.call: init %D = call %ReturnDUsed.ref() to %.loc34_15.1 +// CHECK:STDOUT: %.loc34_15.2: ref %D = temporary %.loc34_15.1, %ReturnDUsed.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon index d8ffb2d2969f..dfc5f612af89 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon @@ -82,12 +82,13 @@ base fn InvalidModifier(); // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:8: error: `private` must appear before `extern` [ModifierMustAppearBefore] +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:8: error: `private` must appear before `extern` [ModifierMustAppearBefore] // CHECK:STDERR: extern private fn ExternOrderAndConflict() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: note: `extern` previously appeared here [ModifierPrevious] +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `extern` previously appeared here [ModifierPrevious] // CHECK:STDERR: extern private fn ExternOrderAndConflict() {} // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: extern private fn ExternOrderAndConflict() {} // CHECK:STDOUT: --- fail_modifiers.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon index 00f1d603d405..8a188061935b 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon @@ -8,13 +8,14 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon -// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+7]]:6: error: expected name in binding pattern [ExpectedBindingPattern] +// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+8]]:6: error: expected name in binding pattern [ExpectedBindingPattern] // CHECK:STDERR: fn F((a: {}, b: {}), c: {}); // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+3]]:6: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] +// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+4]]:6: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] // CHECK:STDERR: fn F((a: {}, b: {}), c: {}); // CHECK:STDERR: ^ +// CHECK:STDERR: fn F((a: {}, b: {}), c: {}); // CHECK:STDOUT: --- fail_pattern_in_signature.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon index 79bfc7b086b0..100b83216f35 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon @@ -49,12 +49,13 @@ fn D() {} fn D(); fn E() {} -// CHECK:STDERR: fail_redecl.carbon:[[@LINE+6]]:1: error: redefinition of `fn E` [RedeclRedef] +// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redefinition of `fn E` [RedeclRedef] // CHECK:STDERR: fn E() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously defined here [RedeclPrevDef] // CHECK:STDERR: fn E() {} // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: fn E() {} // CHECK:STDOUT: --- fail_redecl.carbon @@ -124,7 +125,7 @@ fn E() {} // CHECK:STDOUT: %D.decl.loc41: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %D.decl.loc49: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} {} -// CHECK:STDOUT: %.decl.loc58: %.type.b6a92a.2 = fn_decl @.2 [template = constants.%.d852be.2] {} {} +// CHECK:STDOUT: %.decl.loc59: %.type.b6a92a.2 = fn_decl @.2 [template = constants.%.d852be.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon index b9908112d0d2..6ca4c928e150 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon @@ -51,9 +51,10 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: var x:! () = (); -// CHECK:STDERR: fail_invalid_file_generic_regression_test.carbon:[[@LINE+3]]:1: error: semantics TODO: `function with positional parameters` [SemanticsTodo] +// CHECK:STDERR: fail_invalid_file_generic_regression_test.carbon:[[@LINE+4]]:1: error: semantics TODO: `function with positional parameters` [SemanticsTodo] // CHECK:STDERR: fn A { // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fn A { A(); } diff --git a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon index bb0ea3e1b7e1..4e30031f21a3 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon @@ -54,13 +54,14 @@ fn A(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+7]]:1: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch] +// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch] // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE-5]]:6: in import [InImport] // CHECK:STDERR: extern_impl.carbon:4:1: note: previously declared here [RedeclPrevDecl] // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: extern fn A(); // CHECK:STDOUT: --- basic.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon b/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon index 833296e60ed5..b9fc7667e226 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon @@ -329,9 +329,10 @@ fn F() { class B { var v: A; - // CHECK:STDERR: fail_poison_with_lexical_result.carbon:[[@LINE+3]]:5: note: declared here [NameUseBeforeDeclNote] + // CHECK:STDERR: fail_poison_with_lexical_result.carbon:[[@LINE+4]]:5: note: declared here [NameUseBeforeDeclNote] // CHECK:STDERR: class A {} // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: class A {} } } diff --git a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon index 8cab2a30cf87..d0f932143eb6 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon @@ -66,9 +66,10 @@ library "[[@TEST_NAME]]"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: error: no definition found for declaration in impl file [MissingDefinitionInImpl] +// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file [MissingDefinitionInImpl] // CHECK:STDERR: fn D(); // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: fn D(); // CHECK:STDOUT: --- decl_in_api_definition_in_impl.carbon diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index 2f307ad8ed6a..f72ac2d4b63a 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -98,13 +98,14 @@ library "[[@TEST_NAME]]"; import library "fns"; -// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE+7]]:1: error: redeclarations of `fn D` must match use of `extern` [RedeclExternMismatch] +// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE+8]]:1: error: redeclarations of `fn D` must match use of `extern` [RedeclExternMismatch] // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE-5]]:1: in import [InImport] // CHECK:STDERR: fns.carbon:7:1: note: previously declared here [RedeclPrevDecl] // CHECK:STDERR: fn D(); // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: extern fn D(); fn D() {} @@ -442,13 +443,13 @@ fn D() {} // CHECK:STDOUT: .A = imports.%import_ref.0c3 // CHECK:STDOUT: .B = imports.%import_ref.8cc // CHECK:STDOUT: .C = imports.%import_ref.b05 -// CHECK:STDOUT: .D = %D.decl.loc13 +// CHECK:STDOUT: .D = %D.decl.loc14 // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %D.decl.loc13: %D.type = fn_decl @D [template = constants.%D] {} {} -// CHECK:STDOUT: %D.decl.loc15: %D.type = fn_decl @D [template = constants.%D] {} {} +// CHECK:STDOUT: %D.decl.loc14: %D.type = fn_decl @D [template = constants.%D] {} {} +// CHECK:STDOUT: %D.decl.loc16: %D.type = fn_decl @D [template = constants.%D] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @D() [from "fns.carbon"] { diff --git a/toolchain/check/testdata/function/definition/import_access.carbon b/toolchain/check/testdata/function/definition/import_access.carbon index f81adbd19041..a05a6dc17c57 100644 --- a/toolchain/check/testdata/function/definition/import_access.carbon +++ b/toolchain/check/testdata/function/definition/import_access.carbon @@ -122,9 +122,10 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward"; -// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:13: error: member name `Forward` not found in `Test` [MemberNameNotFoundInScope] +// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+4]]:13: error: member name `Forward` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: var f: () = Test.Forward(); // CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: var f: () = Test.Forward(); // --- todo_fail_private_on_redecl.carbon diff --git a/toolchain/check/testdata/function/definition/no_prelude/basics.carbon b/toolchain/check/testdata/function/definition/no_prelude/basics.carbon index 2a337ac0a2a3..19a8740e8bd5 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/basics.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/basics.carbon @@ -13,12 +13,13 @@ class C; -// CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+6]]:6: error: parameter has incomplete type `C` in function definition [IncompleteTypeInFunctionParam] +// CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+7]]:6: error: parameter has incomplete type `C` in function definition [IncompleteTypeInFunctionParam] // CHECK:STDERR: fn F(n: C) {} // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE-5]]:1: note: class was forward declared here [ClassForwardDeclaredHere] // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: fn F(n: C) {} // CHECK:STDOUT: --- fail_incomplete_type.carbon diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern.carbon b/toolchain/check/testdata/function/definition/no_prelude/extern.carbon index a74976abe996..bfd7c4953f89 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/extern.carbon @@ -105,9 +105,10 @@ library "[[@TEST_NAME]]"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: error: `extern` entities must have a declaration in the API file [ExternRequiresDeclInApiFile] +// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+4]]:1: error: `extern` entities must have a declaration in the API file [ExternRequiresDeclInApiFile] // CHECK:STDERR: extern fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: extern fn F() {} // CHECK:STDOUT: --- extern_def.carbon diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon index 80521c05fcfd..37b97590f2e3 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon @@ -102,9 +102,10 @@ impl library "[[@TEST_NAME]]"; import library "in_impl_extern"; -// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: error: `extern` entities must have a declaration in the API file [ExternRequiresDeclInApiFile] +// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+4]]:1: error: `extern` entities must have a declaration in the API file [ExternRequiresDeclInApiFile] // CHECK:STDERR: extern fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: extern fn F() {} // CHECK:STDOUT: --- one_file_extern.carbon diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon b/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon index 18d73f1ef307..d8f170d90469 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon @@ -56,12 +56,13 @@ fn J() -> (); fn J() {} fn K() -> (); -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+6]]:1: error: function redeclaration differs because return type is `{}` [FunctionRedeclReturnTypeDiffers] +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: function redeclaration differs because return type is `{}` [FunctionRedeclReturnTypeDiffers] // CHECK:STDERR: fn K() -> {} { return {}; } // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with return type `()` [FunctionRedeclReturnTypePrevious] // CHECK:STDERR: fn K() -> (); // CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: fn K() -> {} { return {}; } // CHECK:STDOUT: --- fail_decl_param_mismatch.carbon @@ -177,12 +178,12 @@ fn K() -> {} { return {}; } // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param0 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl.loc65: %.type.b6a92a.6 = fn_decl @.6 [template = constants.%.d852be.6] { +// CHECK:STDOUT: %.decl.loc66: %.type.b6a92a.6 = fn_decl @.6 [template = constants.%.d852be.6] { // CHECK:STDOUT: %return.patt: %empty_struct_type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_struct_type = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc65_12.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc65_12.2: type = converted %.loc65_12.1, constants.%empty_struct_type [template = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc66_12.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc66_12.2: type = converted %.loc66_12.1, constants.%empty_struct_type [template = constants.%empty_struct_type] // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param runtime_param0 // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param // CHECK:STDOUT: } @@ -230,9 +231,9 @@ fn K() -> {} { return {}; } // CHECK:STDOUT: // CHECK:STDOUT: fn @.6() -> %empty_struct_type { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc65_24: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc66_24: %empty_struct_type = struct_literal () // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [template = constants.%empty_struct] -// CHECK:STDOUT: %.loc65_25: %empty_struct_type = converted %.loc65_24, %empty_struct [template = constants.%empty_struct] -// CHECK:STDOUT: return %.loc65_25 +// CHECK:STDOUT: %.loc66_25: %empty_struct_type = converted %.loc66_24, %empty_struct [template = constants.%empty_struct] +// CHECK:STDOUT: return %.loc66_25 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_local_decl.carbon b/toolchain/check/testdata/function/definition/no_prelude/fail_local_decl.carbon index dc4f234a23d6..06b65bcc60bb 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_local_decl.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/fail_local_decl.carbon @@ -40,9 +40,10 @@ fn F() { // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: private var v: {}; - // CHECK:STDERR: fail_access.carbon:[[@LINE+3]]:3: error: `protected` not allowed; requires class scope [ModifierProtectedNotAllowed] + // CHECK:STDERR: fail_access.carbon:[[@LINE+4]]:3: error: `protected` not allowed; requires class scope [ModifierProtectedNotAllowed] // CHECK:STDERR: protected var w: {}; // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: protected var w: {}; } diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon b/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon index 4bf08dcdc632..35035ea7a2c7 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon @@ -9,12 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon fn F() {} -// CHECK:STDERR: fail_redef.carbon:[[@LINE+6]]:1: error: redefinition of `fn F` [RedeclRedef] +// CHECK:STDERR: fail_redef.carbon:[[@LINE+7]]:1: error: redefinition of `fn F` [RedeclRedef] // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_redef.carbon:[[@LINE-4]]:1: note: previously defined here [RedeclPrevDef] // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: fn F() {} // CHECK:STDOUT: --- fail_redef.carbon diff --git a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon index 542baa123d81..1ab7d44c3e9a 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon @@ -111,13 +111,14 @@ alias B = A; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] +// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: fn B() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE-5]]:6: in import [InImport] // CHECK:STDERR: def_alias.carbon:5:7: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: alias B = A; // CHECK:STDERR: ^ +// CHECK:STDERR: fn B() {} // CHECK:STDOUT: --- basic.carbon diff --git a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon index bfaa470e78cd..f49f0bf8d18d 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon @@ -156,16 +156,17 @@ library "[[@TEST_NAME]]"; class C {} fn Foo(a: const C); -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+10]]:11: warning: `const` applied repeatedly to the same type has no additional effect [RepeatedConst] +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+11]]:11: warning: `const` applied repeatedly to the same type has no additional effect [RepeatedConst] // CHECK:STDERR: fn Foo(a: const (const C)) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+6]]:17: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+7]]:17: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] // CHECK:STDERR: fn Foo(a: const (const C)) {} // CHECK:STDERR: ^ // CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:17: note: comparing with previous declaration here [RedeclParamSyntaxPrevious] // CHECK:STDERR: fn Foo(a: const C); // CHECK:STDERR: ^ +// CHECK:STDERR: fn Foo(a: const (const C)) {} // CHECK:STDOUT: --- basic.carbon @@ -823,10 +824,10 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.param_patt: %const = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %a.param: %const = value_param runtime_param0 -// CHECK:STDOUT: %.loc17: type = splice_block %const.loc17_11 [template = constants.%const] { +// CHECK:STDOUT: %.loc18: type = splice_block %const.loc18_11 [template = constants.%const] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %const.loc17_18: type = const_type %C [template = constants.%const] -// CHECK:STDOUT: %const.loc17_11: type = const_type %const [template = constants.%const] +// CHECK:STDOUT: %const.loc18_18: type = const_type %C [template = constants.%const] +// CHECK:STDOUT: %const.loc18_11: type = const_type %const [template = constants.%const] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %const = bind_name a, %a.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 23d917894a8b..eb41ee84e446 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -181,12 +181,13 @@ library "[[@TEST_NAME]]"; fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T; fn CallImplicitNotDeducible() { - // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE+6]]:3: error: inconsistent deductions for value of generic parameter `T` [DeductionInconsistent] + // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE+7]]:3: error: inconsistent deductions for value of generic parameter `T` [DeductionInconsistent] // CHECK:STDERR: ImplicitNotDeducible(42, {.x = 12}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: ImplicitNotDeducible(42, {.x = 12}); } @@ -1463,7 +1464,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %ImplicitNotDeducible.ref: %ImplicitNotDeducible.type = name_ref ImplicitNotDeducible, file.%ImplicitNotDeducible.decl [template = constants.%ImplicitNotDeducible] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42] // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12] -// CHECK:STDOUT: %.loc13: %struct_type.x = struct_literal (%int_12) +// CHECK:STDOUT: %.loc14: %struct_type.x = struct_literal (%int_12) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon b/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon index b45cbaaa613f..56f2779dae8d 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon @@ -10,9 +10,10 @@ fn F(T:! type, U:! type) { var p: T*; - // CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+3]]:3: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound] + // CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+4]]:3: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound] // CHECK:STDERR: let n: U = *p; // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: let n: U = *p; } @@ -56,16 +57,16 @@ fn F(T:! type, U:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ptr: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %ptr (constants.%ptr)] // CHECK:STDOUT: %require_complete.loc12: = require_complete_type @F.%ptr (%ptr) [symbolic = %require_complete.loc12 (constants.%require_complete.6e5)] -// CHECK:STDOUT: %require_complete.loc16: = require_complete_type @F.%U.loc11_16.2 (%U) [symbolic = %require_complete.loc16 (constants.%require_complete.b54)] +// CHECK:STDOUT: %require_complete.loc17: = require_complete_type @F.%U.loc11_16.2 (%U) [symbolic = %require_complete.loc17 (constants.%require_complete.b54)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.param_patt: type, %U.param_patt: type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.var: ref @F.%ptr (%ptr) = var p // CHECK:STDOUT: %p: ref @F.%ptr (%ptr) = bind_name p, %p.var // CHECK:STDOUT: %p.ref: ref @F.%ptr (%ptr) = name_ref p, %p -// CHECK:STDOUT: %.loc16_15: @F.%ptr (%ptr) = bind_value %p.ref -// CHECK:STDOUT: %.loc16_14: ref @F.%T.loc11_6.2 (%T) = deref %.loc16_15 -// CHECK:STDOUT: %.loc16_16: @F.%U.loc11_16.2 (%U) = converted %.loc16_14, [template = ] +// CHECK:STDOUT: %.loc17_15: @F.%ptr (%ptr) = bind_value %p.ref +// CHECK:STDOUT: %.loc17_14: ref @F.%T.loc11_6.2 (%T) = deref %.loc17_15 +// CHECK:STDOUT: %.loc17_16: @F.%U.loc11_16.2 (%U) = converted %.loc17_14, [template = ] // CHECK:STDOUT: %n: @F.%U.loc11_16.2 (%U) = bind_name n, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/redeclare.carbon b/toolchain/check/testdata/function/generic/redeclare.carbon index a1e34d177697..a107958b2a49 100644 --- a/toolchain/check/testdata/function/generic/redeclare.carbon +++ b/toolchain/check/testdata/function/generic/redeclare.carbon @@ -80,12 +80,13 @@ fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fn F(U:! type, T:! type) -> U* { - // CHECK:STDERR: fail_rename.carbon:[[@LINE+6]]:10: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch] + // CHECK:STDERR: fail_rename.carbon:[[@LINE+7]]:10: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch] // CHECK:STDERR: return F(T); // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_rename.carbon:[[@LINE-13]]:1: note: calling function declared here [InCallToEntity] // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: return F(T); } diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index 856c7a6e9d09..bb0073289895 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -27,9 +27,10 @@ fn ErrorIfNIsZero(N:! Core.IntLiteral()) { } fn CallNegative() { - // CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE+3]]:3: note: in `ErrorIfNIsZero(0)` used here [ResolvingSpecificHere] + // CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE+4]]:3: note: in `ErrorIfNIsZero(0)` used here [ResolvingSpecificHere] // CHECK:STDERR: ErrorIfNIsZero(0); // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: ErrorIfNIsZero(0); } diff --git a/toolchain/check/testdata/function/generic/undefined.carbon b/toolchain/check/testdata/function/generic/undefined.carbon index e5f20492ce84..779f7d31a333 100644 --- a/toolchain/check/testdata/function/generic/undefined.carbon +++ b/toolchain/check/testdata/function/generic/undefined.carbon @@ -41,12 +41,13 @@ library "[[@TEST_NAME]]"; fn Undefined[T:! type](x: T) -> T; fn CallUndefined() -> i32 { - // CHECK:STDERR: fail_call_undefined.carbon:[[@LINE+6]]:10: error: use of undefined generic function [MissingGenericFunctionDefinition] + // CHECK:STDERR: fail_call_undefined.carbon:[[@LINE+7]]:10: error: use of undefined generic function [MissingGenericFunctionDefinition] // CHECK:STDERR: return Undefined(0 as i32); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_call_undefined.carbon:[[@LINE-6]]:1: note: generic function declared here [MissingGenericFunctionDefinitionHere] // CHECK:STDERR: fn Undefined[T:! type](x: T) -> T; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: return Undefined(0 as i32); } @@ -374,19 +375,19 @@ fn CallUndefined() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Undefined.ref: %Undefined.type = name_ref Undefined, file.%Undefined.decl [template = constants.%Undefined] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %impl.elem0: %Convert.type.99b = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197] // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc13_22.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc13_22.2: %i32 = converted %int_0, %.loc13_22.1 [template = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc14_22.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc14_22.2: %i32 = converted %int_0, %.loc14_22.1 [template = constants.%int_0.6a9] // CHECK:STDOUT: %Undefined.specific_fn: = specific_function %Undefined.ref, @Undefined(constants.%i32) [template = constants.%Undefined.specific_fn] -// CHECK:STDOUT: %Undefined.call: init %i32 = call %Undefined.specific_fn(%.loc13_22.2) -// CHECK:STDOUT: %.loc13_29.1: %i32 = value_of_initializer %Undefined.call -// CHECK:STDOUT: %.loc13_29.2: %i32 = converted %Undefined.call, %.loc13_29.1 -// CHECK:STDOUT: return %.loc13_29.2 +// CHECK:STDOUT: %Undefined.call: init %i32 = call %Undefined.specific_fn(%.loc14_22.2) +// CHECK:STDOUT: %.loc14_29.1: %i32 = value_of_initializer %Undefined.call +// CHECK:STDOUT: %.loc14_29.2: %i32 = converted %Undefined.call, %.loc14_29.1 +// CHECK:STDOUT: return %.loc14_29.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Undefined(constants.%T) { diff --git a/toolchain/check/testdata/generic/complete_type.carbon b/toolchain/check/testdata/generic/complete_type.carbon index 4d4b632eb8ad..cfa5444ad084 100644 --- a/toolchain/check/testdata/generic/complete_type.carbon +++ b/toolchain/check/testdata/generic/complete_type.carbon @@ -70,9 +70,10 @@ fn F(T:! type) { var v: T; } -// CHECK:STDERR: fail_incomplete_in_function_at_eof.carbon:[[@LINE+3]]:10: note: in `F(B)` used here [ResolvingSpecificHere] +// CHECK:STDERR: fail_incomplete_in_function_at_eof.carbon:[[@LINE+4]]:10: note: in `F(B)` used here [ResolvingSpecificHere] // CHECK:STDERR: fn G() { F(B); } // CHECK:STDERR: ^ +// CHECK:STDERR: fn G() { F(B); } // CHECK:STDOUT: --- fail_incomplete_in_class.carbon diff --git a/toolchain/check/testdata/generic/local.carbon b/toolchain/check/testdata/generic/local.carbon index 545c696acb60..5d2e3507a213 100644 --- a/toolchain/check/testdata/generic/local.carbon +++ b/toolchain/check/testdata/generic/local.carbon @@ -25,12 +25,13 @@ library "[[@TEST_NAME]]"; fn F() { // TODO: Decide on what behavior we want here. We don't reject the corresponding case outside of a function. - // CHECK:STDERR: fail_param_shadows_class.carbon:[[@LINE+6]]:3: error: duplicate name being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fail_param_shadows_class.carbon:[[@LINE+7]]:3: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: class C(C:! type) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_param_shadows_class.carbon:[[@LINE+3]]:11: note: name is previously declared here [NameDeclPrevious] + // CHECK:STDERR: fail_param_shadows_class.carbon:[[@LINE+4]]:11: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: class C(C:! type) { // CHECK:STDERR: ^ + // CHECK:STDERR: class C(C:! type) { } } @@ -186,9 +187,9 @@ class C(C:! type) { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(%C.loc12_11.1: type) { -// CHECK:STDOUT: %C.loc12_11.2: type = bind_symbolic_name C, 0 [symbolic = %C.loc12_11.2 (constants.%C)] -// CHECK:STDOUT: %C.patt.loc12_11.2: type = symbolic_binding_pattern C, 0 [symbolic = %C.patt.loc12_11.2 (constants.%C.patt)] +// CHECK:STDOUT: generic class @.1(%C.loc13_11.1: type) { +// CHECK:STDOUT: %C.loc13_11.2: type = bind_symbolic_name C, 0 [symbolic = %C.loc13_11.2 (constants.%C)] +// CHECK:STDOUT: %C.patt.loc13_11.2: type = symbolic_binding_pattern C, 0 [symbolic = %C.patt.loc13_11.2 (constants.%C.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -201,18 +202,18 @@ class C(C:! type) { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.generic] { -// CHECK:STDOUT: %C.patt.loc12_11.1: type = symbolic_binding_pattern C, 0 [symbolic = %C.patt.loc12_11.2 (constants.%C.patt)] -// CHECK:STDOUT: %C.param_patt: type = value_param_pattern %C.patt.loc12_11.1, runtime_param [symbolic = %C.patt.loc12_11.2 (constants.%C.patt)] +// CHECK:STDOUT: %C.patt.loc13_11.1: type = symbolic_binding_pattern C, 0 [symbolic = %C.patt.loc13_11.2 (constants.%C.patt)] +// CHECK:STDOUT: %C.param_patt: type = value_param_pattern %C.patt.loc13_11.1, runtime_param [symbolic = %C.patt.loc13_11.2 (constants.%C.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.param: type = value_param runtime_param -// CHECK:STDOUT: %C.loc12_11.1: type = bind_symbolic_name C, 0, %C.param [symbolic = %C.loc12_11.2 (constants.%C)] +// CHECK:STDOUT: %C.loc13_11.1: type = bind_symbolic_name C, 0, %C.param [symbolic = %C.loc13_11.2 (constants.%C)] // CHECK:STDOUT: } // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%C) { -// CHECK:STDOUT: %C.loc12_11.2 => constants.%C -// CHECK:STDOUT: %C.patt.loc12_11.2 => constants.%C +// CHECK:STDOUT: %C.loc13_11.2 => constants.%C +// CHECK:STDOUT: %C.patt.loc13_11.2 => constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- nonlocal_param_shadows_class.carbon diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index dcd4fae80688..18772de3c492 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -34,9 +34,10 @@ fn If3(b: bool) -> i32 { if (b) { return 1; } -// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+3]]:1: error: missing `return` at end of function with declared return type [MissingReturnStatement] +// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+4]]:1: error: missing `return` at end of function with declared return type [MissingReturnStatement] // CHECK:STDERR: } // CHECK:STDERR: ^ +// CHECK:STDERR: } // CHECK:STDOUT: --- fail_reachable_fallthrough.carbon diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index beb7901af526..dc4524e13738 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -13,9 +13,10 @@ fn VarScope(b: bool) -> i32 { var n: i32 = 2; return n; } - // CHECK:STDERR: fail_scope.carbon:[[@LINE+3]]:10: error: name `n` not found [NameNotFound] + // CHECK:STDERR: fail_scope.carbon:[[@LINE+4]]:10: error: name `n` not found [NameNotFound] // CHECK:STDERR: return n; // CHECK:STDERR: ^ + // CHECK:STDERR: return n; } @@ -94,7 +95,7 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: return %.loc14 // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %n.ref.loc19: = name_ref n, [template = ] +// CHECK:STDOUT: %n.ref.loc20: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon index fd3b13f4ccf8..fe5c3898170c 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -43,9 +43,10 @@ var y: if true then i32 else f64; fn F(a: if true then i32 else f64); class C { - // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+3]]:10: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] + // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+4]]:10: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var n: if true then i32 else f64; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: var n: if true then i32 else f64; } @@ -95,7 +96,7 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { -// CHECK:STDOUT: %.loc49: %C.elem = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc50: %C.elem = field_decl n, element0 [template] // CHECK:STDOUT: %complete_type: = complete_type_witness %struct_type.n [template = constants.%complete_type.54b] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon index 2dc93ce5c039..2bb78a8d9184 100644 --- a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon +++ b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon @@ -33,9 +33,10 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var v: if true then t else i32 = 1; - // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+3]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] // CHECK:STDERR: var w: if false then i32 else t = 1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: var w: if false then i32 else t = 1; } @@ -126,7 +127,7 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: assign %v.var, // CHECK:STDOUT: %w.var: ref = var w // CHECK:STDOUT: %w: ref = bind_name w, %w.var -// CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1] +// CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: assign %w.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index d25a242dfbed..7bff5cff8018 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -13,9 +13,10 @@ interface Simple { } impl i32 as Simple { - // CHECK:STDERR: fail_call_invalid.carbon:[[@LINE+3]]:14: error: name `Undeclared` not found [NameNotFound] + // CHECK:STDERR: fail_call_invalid.carbon:[[@LINE+4]]:14: error: name `Undeclared` not found [NameNotFound] // CHECK:STDERR: fn G[self: Undeclared](); // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fn G[self: Undeclared](); } @@ -70,7 +71,7 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc22: type = splice_block %i32 [template = constants.%i32] { +// CHECK:STDOUT: %.loc23: type = splice_block %i32 [template = constants.%i32] { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon index 5eb9507258ea..73a4a91b0fa8 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon @@ -13,9 +13,10 @@ interface GenericInterface(T:! type) { } class C { - // CHECK:STDERR: fail_extend_impl_forall.carbon:[[@LINE+3]]:3: error: cannot `extend` a parameterized `impl` [ExtendImplForall] + // CHECK:STDERR: fail_extend_impl_forall.carbon:[[@LINE+4]]:3: error: cannot `extend` a parameterized `impl` [ExtendImplForall] // CHECK:STDERR: extend impl forall [T:! type] as GenericInterface(T) { // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: extend impl forall [T:! type] as GenericInterface(T) { fn F(x: T) {} } @@ -100,24 +101,24 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl(%T.loc19_23.1: type) { -// CHECK:STDOUT: %T.loc19_23.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc19_23.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc19_23.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_23.2 (constants.%T.patt)] -// CHECK:STDOUT: %GenericInterface.type.loc19_54.2: type = facet_type <@GenericInterface, @GenericInterface(%T.loc19_23.2)> [symbolic = %GenericInterface.type.loc19_54.2 (constants.%GenericInterface.type.3fe)] -// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%GenericInterface.type.loc19_54.2 (%GenericInterface.type.3fe) [symbolic = %require_complete (constants.%require_complete.70f)] -// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl(%T.loc19_23.2) [symbolic = %impl_witness (constants.%impl_witness)] +// CHECK:STDOUT: generic impl @impl(%T.loc20_23.1: type) { +// CHECK:STDOUT: %T.loc20_23.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc20_23.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc20_23.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_23.2 (constants.%T.patt)] +// CHECK:STDOUT: %GenericInterface.type.loc20_54.2: type = facet_type <@GenericInterface, @GenericInterface(%T.loc20_23.2)> [symbolic = %GenericInterface.type.loc20_54.2 (constants.%GenericInterface.type.3fe)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%GenericInterface.type.loc20_54.2 (%GenericInterface.type.3fe) [symbolic = %require_complete (constants.%require_complete.70f)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%F.decl), @impl(%T.loc20_23.2) [symbolic = %impl_witness (constants.%impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc19_23.2) [symbolic = %F.type (constants.%F.type.2cb)] +// CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc20_23.2) [symbolic = %F.type (constants.%F.type.2cb)] // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2cb) = struct_value () [symbolic = %F (constants.%F.4b1)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: %Self.ref as %GenericInterface.type.loc19_54.1 { +// CHECK:STDOUT: impl: %Self.ref as %GenericInterface.type.loc20_54.1 { // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2cb) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.4b1)] { // CHECK:STDOUT: %x.patt: @F.2.%T (%T) = binding_pattern x // CHECK:STDOUT: %x.param_patt: @F.2.%T (%T) = value_param_pattern %x.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %x.param: @F.2.%T (%T) = value_param runtime_param0 -// CHECK:STDOUT: %T.ref: type = name_ref T, @impl.%T.loc19_23.1 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, @impl.%T.loc20_23.1 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %x: @F.2.%T (%T) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: @@ -129,18 +130,18 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: impl_decl @impl [template] { -// CHECK:STDOUT: %T.patt.loc19_23.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc19_23.2 (constants.%T.patt)] -// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc19_23.1, runtime_param [symbolic = %T.patt.loc19_23.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.patt.loc20_23.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc20_23.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc20_23.1, runtime_param [symbolic = %T.patt.loc20_23.2 (constants.%T.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %GenericInterface.ref: %GenericInterface.type.c92 = name_ref GenericInterface, file.%GenericInterface.decl [template = constants.%GenericInterface.generic] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc19_23.1 [symbolic = %T.loc19_23.2 (constants.%T)] -// CHECK:STDOUT: %GenericInterface.type.loc19_54.1: type = facet_type <@GenericInterface, @GenericInterface(constants.%T)> [symbolic = %GenericInterface.type.loc19_54.2 (constants.%GenericInterface.type.3fe)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc20_23.1 [symbolic = %T.loc20_23.2 (constants.%T)] +// CHECK:STDOUT: %GenericInterface.type.loc20_54.1: type = facet_type <@GenericInterface, @GenericInterface(constants.%T)> [symbolic = %GenericInterface.type.loc20_54.2 (constants.%GenericInterface.type.3fe)] // CHECK:STDOUT: %T.param: type = value_param runtime_param -// CHECK:STDOUT: %T.loc19_23.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc19_23.2 (constants.%T)] +// CHECK:STDOUT: %T.loc20_23.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc20_23.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%F.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)] -// CHECK:STDOUT: %.loc19: type = specific_constant @impl.%GenericInterface.type.loc19_54.1, @impl(constants.%T) [symbolic = constants.%GenericInterface.type.3fe] +// CHECK:STDOUT: %.loc20: type = specific_constant @impl.%GenericInterface.type.loc20_54.1, @impl(constants.%T) [symbolic = constants.%GenericInterface.type.3fe] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } @@ -151,7 +152,7 @@ class C { // CHECK:STDOUT: fn(%x.param_patt: @F.1.%T (%T)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.2(@impl.%T.loc19_23.1: type) { +// CHECK:STDOUT: generic fn @F.2(@impl.%T.loc20_23.1: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -183,9 +184,9 @@ class C { // CHECK:STDOUT: specific @GenericInterface(%T.loc11_28.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl(constants.%T) { -// CHECK:STDOUT: %T.loc19_23.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc19_23.2 => constants.%T -// CHECK:STDOUT: %GenericInterface.type.loc19_54.2 => constants.%GenericInterface.type.3fe +// CHECK:STDOUT: %T.loc20_23.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc20_23.2 => constants.%T +// CHECK:STDOUT: %GenericInterface.type.loc20_54.2 => constants.%GenericInterface.type.3fe // CHECK:STDOUT: %require_complete => constants.%require_complete.70f // CHECK:STDOUT: %impl_witness => constants.%impl_witness // CHECK:STDOUT: @@ -194,9 +195,9 @@ class C { // CHECK:STDOUT: %F => constants.%F.4b1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @GenericInterface(@impl.%T.loc19_23.2) {} +// CHECK:STDOUT: specific @GenericInterface(@impl.%T.loc20_23.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc19_23.2) {} +// CHECK:STDOUT: specific @impl(%T.loc20_23.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @F.2(constants.%T) { // CHECK:STDOUT: %T => constants.%T diff --git a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon index 5d99b3ad1996..4c6730119b7c 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon @@ -10,9 +10,10 @@ interface I {} -// CHECK:STDERR: fail_extend_impl_scope.carbon:[[@LINE+3]]:1: error: `extend impl` can only be used in a class [ExtendImplOutsideClass] +// CHECK:STDERR: fail_extend_impl_scope.carbon:[[@LINE+4]]:1: error: `extend impl` can only be used in a class [ExtendImplOutsideClass] // CHECK:STDERR: extend impl i32 as I {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: extend impl i32 as I {} // CHECK:STDOUT: --- fail_extend_impl_scope.carbon diff --git a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon index 1b85da753f3a..433e5c3d9891 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon @@ -30,16 +30,17 @@ class D { } class E { - // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+10]]:3: error: cannot `extend` an `impl` with an explicit self type [ExtendImplSelfAs] + // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+11]]:3: error: cannot `extend` an `impl` with an explicit self type [ExtendImplSelfAs] // CHECK:STDERR: extend impl Self as I {} // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+7]]:15: note: remove the explicit `Self` type here [ExtendImplSelfAsDefault] + // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+8]]:15: note: remove the explicit `Self` type here [ExtendImplSelfAsDefault] // CHECK:STDERR: extend impl Self as I {} // CHECK:STDERR: ^~~~ // CHECK:STDERR: // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE-11]]:3: error: impl declared but not defined [ImplMissingDefinition] // CHECK:STDERR: extend impl D as I; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: extend impl Self as I {} } diff --git a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon index 9e10b79eecf5..054e9a148f8e 100644 --- a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon @@ -9,17 +9,18 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_extend_non_interface.carbon class C { - // CHECK:STDERR: fail_extend_non_interface.carbon:[[@LINE+11]]:3: error: impl as non-facet type `i32` [ImplAsNonFacetType] + // CHECK:STDERR: fail_extend_non_interface.carbon:[[@LINE+12]]:3: error: impl as non-facet type `i32` [ImplAsNonFacetType] // CHECK:STDERR: extend impl as i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_extend_non_interface.carbon:[[@LINE+7]]:3: error: semantics TODO: `extending non-facet-type constraint` [SemanticsTodo] + // CHECK:STDERR: fail_extend_non_interface.carbon:[[@LINE+8]]:3: error: semantics TODO: `extending non-facet-type constraint` [SemanticsTodo] // CHECK:STDERR: extend impl as i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_extend_non_interface.carbon:[[@LINE+3]]:3: error: impl declared but not defined [ImplMissingDefinition] + // CHECK:STDERR: fail_extend_non_interface.carbon:[[@LINE+4]]:3: error: impl declared but not defined [ImplMissingDefinition] // CHECK:STDERR: extend impl as i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: extend impl as i32; } diff --git a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon index 9d41c78d65e0..a2a3c2bf579f 100644 --- a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon @@ -10,16 +10,17 @@ interface I { class C { - // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE+10]]:5: error: implementation of undefined interface I [ImplOfUndefinedInterface] + // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE+11]]:5: error: implementation of undefined interface I [ImplOfUndefinedInterface] // CHECK:STDERR: extend impl as I; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE-5]]:1: note: interface is currently being defined [InterfaceUndefinedWithinDefinition] // CHECK:STDERR: interface I { // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE+3]]:5: error: impl declared but not defined [ImplMissingDefinition] + // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE+4]]:5: error: impl declared but not defined [ImplMissingDefinition] // CHECK:STDERR: extend impl as I; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ + // CHECK:STDERR: extend impl as I; } } @@ -76,7 +77,7 @@ interface I { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C.6b4 [symbolic = %C (constants.%C.6b4)] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc23: type = specific_constant @impl.%I.ref, @impl(constants.%Self) [template = constants.%I.type] +// CHECK:STDOUT: %.loc24: type = specific_constant @impl.%I.ref, @impl(constants.%Self) [template = constants.%I.type] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon index 6ab7f3735594..01461cbb3cae 100644 --- a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon @@ -33,7 +33,7 @@ fn F(c: C) { // CHECK:STDERR: ^ // CHECK:STDERR: C.F(); - // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE+13]]:3: error: member access into undefined interface `I` [QualifiedExprInUndefinedInterfaceScope] + // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE+14]]:3: error: member access into undefined interface `I` [QualifiedExprInUndefinedInterfaceScope] // CHECK:STDERR: c.F(); // CHECK:STDERR: ^~~ // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE-28]]:1: note: interface was forward declared here [InterfaceForwardDeclaredHere] @@ -46,6 +46,7 @@ fn F(c: C) { // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE-25]]:3: error: impl declared but not defined [ImplMissingDefinition] // CHECK:STDERR: extend impl as I; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ + // CHECK:STDERR: c.F(); } @@ -105,7 +106,7 @@ fn F(c: C) { // CHECK:STDOUT: %C.ref.loc35: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %F.ref.loc35: = name_ref F, [template = ] // CHECK:STDOUT: %c.ref: %C = name_ref c, %c -// CHECK:STDOUT: %F.ref.loc49: = name_ref F, [template = ] +// CHECK:STDOUT: %F.ref.loc50: = name_ref F, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon index 95e0ee7752f9..4818a78b1c7c 100644 --- a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon +++ b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon @@ -33,9 +33,10 @@ interface Simple { } fn Function() { - // CHECK:STDERR: fail_function.carbon:[[@LINE+3]]:8: error: `impl as` can only be used in a class [ImplAsOutsideClass] + // CHECK:STDERR: fail_function.carbon:[[@LINE+4]]:8: error: `impl as` can only be used in a class [ImplAsOutsideClass] // CHECK:STDERR: impl as Simple { // CHECK:STDERR: ^~ + // CHECK:STDERR: impl as Simple { fn F() {} } diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index e44a6b50eaa5..8c238d044fc4 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -203,12 +203,13 @@ class SelfNestedBadParam { class SelfNestedBadReturnType { impl as SelfNested { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+6]]:5: error: function redeclaration differs because return type is `[SelfNestedBadParam; 4]` [FunctionRedeclReturnTypeDiffers] + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because return type is `[SelfNestedBadParam; 4]` [FunctionRedeclReturnTypeDiffers] // CHECK:STDERR: fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> [SelfNestedBadParam; 4]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-21]]:3: note: previously declared with return type `[SelfNestedBadReturnType; 4]` [FunctionRedeclReturnTypePrevious] // CHECK:STDERR: fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> [SelfNestedBadParam; 4]; } } @@ -797,15 +798,15 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4] // CHECK:STDOUT: %array_type: type = array_type %int_4, %SelfNestedBadParam [template = constants.%array_type.a41] // CHECK:STDOUT: %x.param: %tuple.type.eb9 = value_param runtime_param0 -// CHECK:STDOUT: %.loc212_78.1: type = splice_block %.loc212_78.3 [template = constants.%tuple.type.eb9] { -// CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_14: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] +// CHECK:STDOUT: %.loc213_78.1: type = splice_block %.loc213_78.3 [template = constants.%tuple.type.eb9] { +// CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc213_14: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] // CHECK:STDOUT: %ptr: type = ptr_type %SelfNestedBadReturnType [template = constants.%ptr.612] -// CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] +// CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc213_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.x.y: type = struct_type {.x: %SelfNestedBadReturnType, .y: %i32} [template = constants.%struct_type.x.y.ac5] -// CHECK:STDOUT: %.loc212_78.2: %tuple.type.24b = tuple_literal (%ptr, %struct_type.x.y) -// CHECK:STDOUT: %.loc212_78.3: type = converted %.loc212_78.2, constants.%tuple.type.eb9 [template = constants.%tuple.type.eb9] +// CHECK:STDOUT: %.loc213_78.2: %tuple.type.24b = tuple_literal (%ptr, %struct_type.x.y) +// CHECK:STDOUT: %.loc213_78.3: type = converted %.loc213_78.2, constants.%tuple.type.eb9 [template = constants.%tuple.type.eb9] // CHECK:STDOUT: } // CHECK:STDOUT: %x: %tuple.type.eb9 = bind_name x, %x.param // CHECK:STDOUT: %return.param: ref %array_type.a41 = out_param runtime_param1 diff --git a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon index 3ea235eb825d..4dd3db7fa213 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -38,9 +38,10 @@ library "[[@TEST_NAME]]"; // Note: This code is not expected to pass checking, even once the TODO is // addressed. -// CHECK:STDERR: fail_impl_as_type_where.carbon:[[@LINE+3]]:1: error: semantics TODO: `impl as not 1 interface` [SemanticsTodo] +// CHECK:STDERR: fail_impl_as_type_where.carbon:[[@LINE+4]]:1: error: semantics TODO: `impl as not 1 interface` [SemanticsTodo] // CHECK:STDERR: impl f64 as type where .Self impls type {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: impl f64 as type where .Self impls type {} // CHECK:STDOUT: --- fail_impl_as_false.carbon @@ -136,17 +137,17 @@ impl f64 as type where .Self impls type {} // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64] -// CHECK:STDOUT: %.loc10_6.1: type = value_of_initializer %float.make_type [template = f64] -// CHECK:STDOUT: %.loc10_6.2: type = converted %float.make_type, %.loc10_6.1 [template = f64] +// CHECK:STDOUT: %.loc11_6.1: type = value_of_initializer %float.make_type [template = f64] +// CHECK:STDOUT: %.loc11_6.2: type = converted %float.make_type, %.loc11_6.1 [template = f64] // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic = constants.%.Self] // CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.loc10_18: type = where_expr %.Self [template = constants.%type_where] { +// CHECK:STDOUT: %.loc11_18: type = where_expr %.Self [template = constants.%type_where] { // CHECK:STDOUT: requirement_impls %.Self.ref, type // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc10_6.2 as %.loc10_18 { +// CHECK:STDOUT: impl @impl: %.loc11_6.2 as %.loc11_18 { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_redefinition.carbon b/toolchain/check/testdata/impl/fail_redefinition.carbon index 1d07be8143e9..efe53fda0840 100644 --- a/toolchain/check/testdata/impl/fail_redefinition.carbon +++ b/toolchain/check/testdata/impl/fail_redefinition.carbon @@ -12,12 +12,13 @@ interface I {} impl i32 as I {} -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+6]]:1: error: redefinition of `impl i32 as I` [ImplRedefinition] +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+7]]:1: error: redefinition of `impl i32 as I` [ImplRedefinition] // CHECK:STDERR: impl i32 as I {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_redefinition.carbon:[[@LINE-5]]:1: note: previous definition was here [ImplPreviousDefinition] // CHECK:STDERR: impl i32 as I {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: impl i32 as I {} // CHECK:STDOUT: --- fail_redefinition.carbon @@ -56,7 +57,7 @@ impl i32 as I {} // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl_witness.loc21: = impl_witness () [template = constants.%impl_witness] +// CHECK:STDOUT: %impl_witness.loc22: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -74,6 +75,6 @@ impl i32 as I {} // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %i32 as %I.ref { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%impl_witness.loc21 +// CHECK:STDOUT: witness = file.%impl_witness.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon index 056f1e412ec3..691f6ee3c9ab 100644 --- a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon +++ b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon @@ -15,12 +15,13 @@ interface I { } impl i32 as I { - // CHECK:STDERR: fail_self_type_mismatch.carbon:[[@LINE+6]]:8: error: type `C(i32)` of parameter 1 in redeclaration differs from previous parameter type `C(i32 as I)` [RedeclParamDiffersType] + // CHECK:STDERR: fail_self_type_mismatch.carbon:[[@LINE+7]]:8: error: type `C(i32)` of parameter 1 in redeclaration differs from previous parameter type `C(i32 as I)` [RedeclParamDiffersType] // CHECK:STDERR: fn F(c: C(i32)); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_self_type_mismatch.carbon:[[@LINE-7]]:8: note: previous declaration's corresponding parameter here [RedeclParamPrevious] // CHECK:STDERR: fn F(c: C(Self)); // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fn F(c: C(i32)); } @@ -116,7 +117,7 @@ impl i32 as I { // CHECK:STDOUT: %c.param_patt: %C.6fb = value_param_pattern %c.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %c.param: %C.6fb = value_param runtime_param0 -// CHECK:STDOUT: %.loc24: type = splice_block %C [template = constants.%C.6fb] { +// CHECK:STDOUT: %.loc25: type = splice_block %C [template = constants.%C.6fb] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] diff --git a/toolchain/check/testdata/impl/fail_todo_use_assoc_const.carbon b/toolchain/check/testdata/impl/fail_todo_use_assoc_const.carbon index 3f91b06fd4be..55541d667732 100644 --- a/toolchain/check/testdata/impl/fail_todo_use_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_todo_use_assoc_const.carbon @@ -69,12 +69,13 @@ library "[[@TEST_NAME]]"; interface I { let N:! i32; - // CHECK:STDERR: fail_todo_associated_int_in_array.carbon:[[@LINE+6]]:32: error: cannot implicitly convert from `` to `Core.IntLiteral` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_todo_associated_int_in_array.carbon:[[@LINE+7]]:32: error: cannot implicitly convert from `` to `Core.IntLiteral` [ImplicitAsConversionFailure] // CHECK:STDERR: fn F[self: Self]() -> [bool; N]; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_todo_associated_int_in_array.carbon:[[@LINE+3]]:32: note: type `` does not implement interface `Core.ImplicitAs(Core.IntLiteral)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_todo_associated_int_in_array.carbon:[[@LINE+4]]:32: note: type `` does not implement interface `Core.ImplicitAs(Core.IntLiteral)` [MissingImplInMemberAccessNote] // CHECK:STDERR: fn F[self: Self]() -> [bool; N]; // CHECK:STDERR: ^ + // CHECK:STDERR: fn F[self: Self]() -> [bool; N]; } @@ -477,23 +478,23 @@ impl () as I where .N = 2 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @impl.44 [template] {} { -// CHECK:STDOUT: %.loc14_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc14_7.2: type = converted %.loc14_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc15_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc15_7.2: type = converted %.loc15_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self] // CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self] // CHECK:STDOUT: %N.ref: %assoc_type = name_ref N, @I.%assoc0 [template = constants.%assoc0.9f1] // CHECK:STDOUT: %.Self.as_wit: = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0.loc14_20: %i32 = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %impl.elem0.loc15_20: %i32 = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc14_25: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0.loc14_25 [template = constants.%Convert.bound] +// CHECK:STDOUT: %impl.elem0.loc15_25: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0.loc15_25 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc14_25.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc14_25.2: %i32 = converted %int_2, %.loc14_25.1 [template = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc14_14: type = where_expr %.Self [template = constants.%I_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc14_20, %.loc14_25.2 +// CHECK:STDOUT: %.loc15_25.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc15_25.2: %i32 = converted %int_2, %.loc15_25.1 [template = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc15_14: type = where_expr %.Self [template = constants.%I_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc15_20, %.loc15_25.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %impl_witness: = impl_witness (constants.%int_2.ef8, ) [template = constants.%impl_witness.2c9] @@ -504,24 +505,24 @@ impl () as I where .N = 2 { // CHECK:STDOUT: %N: %i32 = assoc_const_decl N [template] // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, %N [template = constants.%assoc0.9f1] // CHECK:STDOUT: %F.decl: %F.type.cf0 = fn_decl @F.1 [template = constants.%F.bc6] { -// CHECK:STDOUT: %self.patt: @F.1.%Self.as_type.loc11_14.1 (%Self.as_type.b70) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @F.1.%Self.as_type.loc11_14.1 (%Self.as_type.b70) = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.b70) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.b70) = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: %return.patt: = return_slot_pattern // CHECK:STDOUT: %return.param_patt: = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %N.ref: %assoc_type = name_ref N, @I.%assoc0 [template = constants.%assoc0.9f1] -// CHECK:STDOUT: %.loc11_26.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc11_26.2: type = converted %bool.make_type, %.loc11_26.1 [template = bool] -// CHECK:STDOUT: %.loc11_32: Core.IntLiteral = converted %N.ref, [template = ] +// CHECK:STDOUT: %.loc12_26.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc12_26.2: type = converted %bool.make_type, %.loc12_26.1 [template = bool] +// CHECK:STDOUT: %.loc12_32: Core.IntLiteral = converted %N.ref, [template = ] // CHECK:STDOUT: %array_type: type = array_type , bool [template = ] -// CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc11_14.1 (%Self.as_type.b70) = value_param runtime_param0 -// CHECK:STDOUT: %.loc11_14.1: type = splice_block %.loc11_14.2 [symbolic = %Self.as_type.loc11_14.1 (constants.%Self.as_type.b70)] { +// CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.b70) = value_param runtime_param0 +// CHECK:STDOUT: %.loc12_14.1: type = splice_block %.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.b70)] { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.826)] -// CHECK:STDOUT: %Self.as_type.loc11_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc11_14.1 (constants.%Self.as_type.b70)] -// CHECK:STDOUT: %.loc11_14.2: type = converted %Self.ref, %Self.as_type.loc11_14.2 [symbolic = %Self.as_type.loc11_14.1 (constants.%Self.as_type.b70)] +// CHECK:STDOUT: %Self.as_type.loc12_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.b70)] +// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref, %Self.as_type.loc12_14.2 [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.b70)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @F.1.%Self.as_type.loc11_14.1 (%Self.as_type.b70) = bind_name self, %self.param +// CHECK:STDOUT: %self: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.b70) = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref = out_param runtime_param1 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } @@ -534,7 +535,7 @@ impl () as I where .N = 2 { // CHECK:STDOUT: witness = (%N, %F.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.44: %.loc14_7.2 as %.loc14_14 { +// CHECK:STDOUT: impl @impl.44: %.loc15_7.2 as %.loc15_14 { // CHECK:STDOUT: %F.decl: %F.type.9f6 = fn_decl @F.2 [template = constants.%F.572] { // CHECK:STDOUT: %self.patt: %empty_tuple.type = binding_pattern self // CHECK:STDOUT: %self.param_patt: %empty_tuple.type = value_param_pattern %self.patt, runtime_param0 @@ -543,11 +544,11 @@ impl () as I where .N = 2 { // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc15_26.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc15_26.2: type = converted %bool.make_type, %.loc15_26.1 [template = bool] +// CHECK:STDOUT: %.loc16_26.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc16_26.2: type = converted %bool.make_type, %.loc16_26.1 [template = bool] // CHECK:STDOUT: %array_type: type = array_type %int_2, bool [template = constants.%array_type] // CHECK:STDOUT: %self.param: %empty_tuple.type = value_param runtime_param0 -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.44.%.loc14_7.2 [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.44.%.loc15_7.2 [template = constants.%empty_tuple.type] // CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param // CHECK:STDOUT: %return.param: ref %array_type = out_param runtime_param1 // CHECK:STDOUT: %return: ref %array_type = return_slot %return.param @@ -560,34 +561,34 @@ impl () as I where .N = 2 { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.826)] -// CHECK:STDOUT: %Self.as_type.loc11_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc11_14.1 (constants.%Self.as_type.b70)] +// CHECK:STDOUT: %Self.as_type.loc12_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc12_14.1 (constants.%Self.as_type.b70)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self.as_type.loc11_14.1 (%Self.as_type.b70)]() -> ; +// CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self.as_type.loc12_14.1 (%Self.as_type.b70)]() -> ; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2[%self.param_patt: %empty_tuple.type]() -> %return.param_patt: %array_type { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] // CHECK:STDOUT: %false: bool = bool_literal false [template = constants.%false] -// CHECK:STDOUT: %.loc15_56.1: %tuple.type = tuple_literal (%true, %false) +// CHECK:STDOUT: %.loc16_56.1: %tuple.type = tuple_literal (%true, %false) // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] -// CHECK:STDOUT: %.loc15_56.2: ref bool = array_index %return, %int_0 -// CHECK:STDOUT: %.loc15_56.3: init bool = initialize_from %true to %.loc15_56.2 [template = constants.%true] +// CHECK:STDOUT: %.loc16_56.2: ref bool = array_index %return, %int_0 +// CHECK:STDOUT: %.loc16_56.3: init bool = initialize_from %true to %.loc16_56.2 [template = constants.%true] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %.loc15_56.4: ref bool = array_index %return, %int_1 -// CHECK:STDOUT: %.loc15_56.5: init bool = initialize_from %false to %.loc15_56.4 [template = constants.%false] -// CHECK:STDOUT: %.loc15_56.6: init %array_type = array_init (%.loc15_56.3, %.loc15_56.5) to %return [template = constants.%array] -// CHECK:STDOUT: %.loc15_57: init %array_type = converted %.loc15_56.1, %.loc15_56.6 [template = constants.%array] -// CHECK:STDOUT: return %.loc15_57 to %return +// CHECK:STDOUT: %.loc16_56.4: ref bool = array_index %return, %int_1 +// CHECK:STDOUT: %.loc16_56.5: init bool = initialize_from %false to %.loc16_56.4 [template = constants.%false] +// CHECK:STDOUT: %.loc16_56.6: init %array_type = array_init (%.loc16_56.3, %.loc16_56.5) to %return [template = constants.%array] +// CHECK:STDOUT: %.loc16_57: init %array_type = converted %.loc16_56.1, %.loc16_56.6 [template = constants.%array] +// CHECK:STDOUT: return %.loc16_57 to %return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self.826) { // CHECK:STDOUT: %Self => constants.%Self.826 -// CHECK:STDOUT: %Self.as_type.loc11_14.1 => constants.%Self.as_type.b70 +// CHECK:STDOUT: %Self.as_type.loc12_14.1 => constants.%Self.as_type.b70 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%I.facet) { // CHECK:STDOUT: %Self => constants.%I.facet -// CHECK:STDOUT: %Self.as_type.loc11_14.1 => constants.%empty_tuple.type +// CHECK:STDOUT: %Self.as_type.loc12_14.1 => constants.%empty_tuple.type // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon b/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon index 9c6a8d06de2a..196807c82ac6 100644 --- a/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon @@ -22,9 +22,10 @@ fn F(c: C) { // CHECK:STDERR: ^~~ // CHECK:STDERR: C.F(); - // CHECK:STDERR: fail_alias_impl_not_found.carbon:[[@LINE+3]]:3: error: cannot access member of interface `I` in type `C` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_alias_impl_not_found.carbon:[[@LINE+4]]:3: error: cannot access member of interface `I` in type `C` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: c.F(); // CHECK:STDERR: ^~~ + // CHECK:STDERR: c.F(); } @@ -100,7 +101,7 @@ fn F(c: C) { // CHECK:STDOUT: %C.ref.loc24: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %F.ref.loc24: %F.assoc_type = name_ref F, @C.%F [template = constants.%assoc0] // CHECK:STDOUT: %c.ref: %C = name_ref c, %c -// CHECK:STDOUT: %F.ref.loc28: %F.assoc_type = name_ref F, @C.%F [template = constants.%assoc0] +// CHECK:STDOUT: %F.ref.loc29: %F.assoc_type = name_ref F, @C.%F [template = constants.%assoc0] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon index 1a47326c99e8..0e2e31fdbc01 100644 --- a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon @@ -19,13 +19,14 @@ class C { } fn F() -> i32 { - // CHECK:STDERR: fail_todo_undefined_impl.carbon:[[@LINE+7]]:10: error: accessing member from impl before the end of its definition [ImplAccessMemberBeforeComplete] + // CHECK:STDERR: fail_todo_undefined_impl.carbon:[[@LINE+8]]:10: error: accessing member from impl before the end of its definition [ImplAccessMemberBeforeComplete] // CHECK:STDERR: return C.F(); // CHECK:STDERR: ^~~ // CHECK:STDERR: // CHECK:STDERR: fail_todo_undefined_impl.carbon:[[@LINE-8]]:3: error: impl declared but not defined [ImplMissingDefinition] // CHECK:STDERR: extend impl as I; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ + // CHECK:STDERR: return C.F(); } diff --git a/toolchain/check/testdata/impl/lookup/generic.carbon b/toolchain/check/testdata/impl/lookup/generic.carbon index 2e268b16b8d2..5f2dbe5b3b56 100644 --- a/toolchain/check/testdata/impl/lookup/generic.carbon +++ b/toolchain/check/testdata/impl/lookup/generic.carbon @@ -115,9 +115,10 @@ class B {} fn G(x: A) { // TODO: It'd be nice to include a note here saying that deduction failed because // we deduced two different values for `T`. - // CHECK:STDERR: fail_inconsistent_deduction.carbon:[[@LINE+3]]:3: error: cannot access member of interface `HasF(B)` in type `A` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_inconsistent_deduction.carbon:[[@LINE+4]]:3: error: cannot access member of interface `HasF(B)` in type `A` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: x.(HasF(B).F)(); // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: x.(HasF(B).F)(); } @@ -1183,8 +1184,8 @@ fn G(x: A) { // CHECK:STDOUT: %HasF.ref: %HasF.type.fe3 = name_ref HasF, file.%HasF.decl [template = constants.%HasF.generic] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF, @HasF(constants.%B)> [template = constants.%HasF.type.2f5] -// CHECK:STDOUT: %.loc21: %F.assoc_type.00a = specific_constant @HasF.%assoc0.loc5_9.1, @HasF(constants.%B) [template = constants.%assoc0.c2a] -// CHECK:STDOUT: %F.ref: %F.assoc_type.00a = name_ref F, %.loc21 [template = constants.%assoc0.c2a] +// CHECK:STDOUT: %.loc22: %F.assoc_type.00a = specific_constant @HasF.%assoc0.loc5_9.1, @HasF(constants.%B) [template = constants.%assoc0.c2a] +// CHECK:STDOUT: %F.ref: %F.assoc_type.00a = name_ref F, %.loc22 [template = constants.%assoc0.c2a] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon index f123a533b444..9d1dbb6285f2 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon @@ -183,9 +183,10 @@ import HasExtraInterfaces; fn Test(c: HasExtraInterfaces.C(type)) { // This triggers the import of a bunch more interfaces, which reallocates the // interface ValueStore. Ensure that doesn't result in a use-after-free crash. - // CHECK:STDERR: fail_use_has_extra_interfaces.carbon:[[@LINE+3]]:3: error: cannot access member of interface `HasExtraInterfaces.I` in type `HasExtraInterfaces.C(type)` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_use_has_extra_interfaces.carbon:[[@LINE+4]]:3: error: cannot access member of interface `HasExtraInterfaces.I` in type `HasExtraInterfaces.C(type)` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: c.(HasExtraInterfaces.I.F)(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: c.(HasExtraInterfaces.I.F)(); } @@ -1802,7 +1803,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: fn @Test(%c.param_patt: %C.42e) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C.42e = name_ref c, %c -// CHECK:STDOUT: %HasExtraInterfaces.ref.loc11: = name_ref HasExtraInterfaces, imports.%HasExtraInterfaces [template = imports.%HasExtraInterfaces] +// CHECK:STDOUT: %HasExtraInterfaces.ref.loc12: = name_ref HasExtraInterfaces, imports.%HasExtraInterfaces [template = imports.%HasExtraInterfaces] // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.df2 [template = constants.%I.type] // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, imports.%import_ref.fd4 [template = constants.%assoc0] // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/impl/multiple_extend.carbon b/toolchain/check/testdata/impl/multiple_extend.carbon index 58b7e82de6da..f3eb6832b26b 100644 --- a/toolchain/check/testdata/impl/multiple_extend.carbon +++ b/toolchain/check/testdata/impl/multiple_extend.carbon @@ -121,9 +121,10 @@ fn M(l: L) { // CHECK:STDERR: ^~~ // CHECK:STDERR: L.K(); - // CHECK:STDERR: fail_ambiguous_impl_and_base.carbon:[[@LINE+3]]:4: error: ambiguous use of name `K` found in multiple extended scopes [NameAmbiguousDueToExtend] + // CHECK:STDERR: fail_ambiguous_impl_and_base.carbon:[[@LINE+4]]:4: error: ambiguous use of name `K` found in multiple extended scopes [NameAmbiguousDueToExtend] // CHECK:STDERR: l.K(); // CHECK:STDERR: ^~~ + // CHECK:STDERR: l.K(); } @@ -713,7 +714,7 @@ fn P(o: O) { // CHECK:STDOUT: %L.ref.loc24: type = name_ref L, file.%L.decl [template = constants.%L] // CHECK:STDOUT: %K.ref.loc24: = name_ref K, [template = ] // CHECK:STDOUT: %l.ref: %L = name_ref l, %l -// CHECK:STDOUT: %K.ref.loc28: = name_ref K, [template = ] +// CHECK:STDOUT: %K.ref.loc29: = name_ref K, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/error_recovery.carbon b/toolchain/check/testdata/impl/no_prelude/error_recovery.carbon index 32c316916380..4c0a7ec1a95c 100644 --- a/toolchain/check/testdata/impl/no_prelude/error_recovery.carbon +++ b/toolchain/check/testdata/impl/no_prelude/error_recovery.carbon @@ -13,9 +13,10 @@ class C {} interface I {} -// CHECK:STDERR: fail_fuzz_crash.carbon:[[@LINE+3]]:14: error: parameters of generic types must be constant [GenericParamMustBeConstant] +// CHECK:STDERR: fail_fuzz_crash.carbon:[[@LINE+4]]:14: error: parameters of generic types must be constant [GenericParamMustBeConstant] // CHECK:STDERR: impl forall [T: type] C as I { } // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: impl forall [T: type] C as I { } // CHECK:STDOUT: --- fail_fuzz_crash.carbon diff --git a/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon b/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon index 22491e81ac02..3b81f9d77810 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon +++ b/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon @@ -16,12 +16,13 @@ alias AC = C; impl AC as AI {} -// CHECK:STDERR: fail_alias.carbon:[[@LINE+6]]:1: error: redefinition of `impl AC as AI` [ImplRedefinition] +// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:1: error: redefinition of `impl AC as AI` [ImplRedefinition] // CHECK:STDERR: impl AC as AI {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_alias.carbon:[[@LINE-5]]:1: note: previous definition was here [ImplPreviousDefinition] // CHECK:STDERR: impl AC as AI {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: impl AC as AI {} // CHECK:STDOUT: --- fail_alias.carbon @@ -57,7 +58,7 @@ impl AC as AI {} // CHECK:STDOUT: %AC.ref: type = name_ref AC, file.%AC [template = constants.%C] // CHECK:STDOUT: %AI.ref: type = name_ref AI, file.%AI [template = constants.%I.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl_witness.loc25: = impl_witness () [template = constants.%impl_witness] +// CHECK:STDOUT: %impl_witness.loc26: = impl_witness () [template = constants.%impl_witness] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -75,7 +76,7 @@ impl AC as AI {} // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %AC.ref as %AI.ref { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%impl_witness.loc25 +// CHECK:STDOUT: witness = file.%impl_witness.loc26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_assoc_const.carbon b/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_assoc_const.carbon index 40a92776d1a7..0fdc707f9e0f 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_assoc_const.carbon +++ b/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_assoc_const.carbon @@ -10,12 +10,13 @@ interface I { let T:! type; } -// CHECK:STDERR: fail_impl_bad_assoc_const.carbon:[[@LINE+6]]:12: error: associated constant T not given a value in impl of interface I [ImplAssociatedConstantNeedsValue] +// CHECK:STDERR: fail_impl_bad_assoc_const.carbon:[[@LINE+7]]:12: error: associated constant T not given a value in impl of interface I [ImplAssociatedConstantNeedsValue] // CHECK:STDERR: impl () as I {} // CHECK:STDERR: ^ // CHECK:STDERR: fail_impl_bad_assoc_const.carbon:[[@LINE-5]]:15: note: associated constant T declared here [AssociatedConstantHere] // CHECK:STDERR: interface I { let T:! type; } // CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: impl () as I {} // CHECK:STDOUT: --- fail_impl_bad_assoc_const.carbon @@ -35,8 +36,8 @@ impl () as I {} // CHECK:STDOUT: } // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { -// CHECK:STDOUT: %.loc19_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc19_7.2: type = converted %.loc19_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc20_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc20_7.2: type = converted %.loc20_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] @@ -53,7 +54,7 @@ impl () as I {} // CHECK:STDOUT: witness = (%T) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc19_7.2 as %I.ref { +// CHECK:STDOUT: impl @impl: %.loc20_7.2 as %I.ref { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon b/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon index cf5e9756a8f1..03a077f4f053 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon +++ b/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon @@ -10,9 +10,10 @@ interface I {} -// CHECK:STDERR: fail_impl_bad_type.carbon:[[@LINE+3]]:6: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound] +// CHECK:STDERR: fail_impl_bad_type.carbon:[[@LINE+4]]:6: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound] // CHECK:STDERR: impl true as I {} // CHECK:STDERR: ^~~~ +// CHECK:STDERR: impl true as I {} // CHECK:STDOUT: --- fail_impl_bad_type.carbon @@ -31,7 +32,7 @@ impl true as I {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { // CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: %.loc16: type = converted %true, [template = ] +// CHECK:STDOUT: %.loc17: type = converted %true, [template = ] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: } // CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] diff --git a/toolchain/check/testdata/impl/no_prelude/fail_undefined_interface.carbon b/toolchain/check/testdata/impl/no_prelude/fail_undefined_interface.carbon index 8252a680b250..585bf45f1edf 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_undefined_interface.carbon +++ b/toolchain/check/testdata/impl/no_prelude/fail_undefined_interface.carbon @@ -28,12 +28,13 @@ library "[[@TEST_NAME]]"; interface J; class C {} -// CHECK:STDERR: fail_class.carbon:[[@LINE+6]]:1: error: implementation of undefined interface J [ImplOfUndefinedInterface] +// CHECK:STDERR: fail_class.carbon:[[@LINE+7]]:1: error: implementation of undefined interface J [ImplOfUndefinedInterface] // CHECK:STDERR: impl C as J {} // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_class.carbon:[[@LINE-5]]:1: note: interface was forward declared here [InterfaceForwardDeclaredHere] // CHECK:STDERR: interface J; // CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: impl C as J {} // CHECK:STDOUT: --- fail_empty_struct.carbon diff --git a/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon b/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon index 6fe09a4a9e4d..87fccd4b81a3 100644 --- a/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon +++ b/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon @@ -72,12 +72,13 @@ impl forall [T:! type] T as I { fn A() {} } -// CHECK:STDERR: fail_redefinition_generic_regions.carbon:[[@LINE+6]]:1: error: redefinition of `impl T as I` [ImplRedefinition] +// CHECK:STDERR: fail_redefinition_generic_regions.carbon:[[@LINE+7]]:1: error: redefinition of `impl T as I` [ImplRedefinition] // CHECK:STDERR: impl forall [T:! type] T as I { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_redefinition_generic_regions.carbon:[[@LINE-7]]:1: note: previous definition was here [ImplPreviousDefinition] // CHECK:STDERR: impl forall [T:! type] T as I { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: impl forall [T:! type] T as I { // Although not referenced, B has the same generic region index of A, and // makes C a different index. We used to merge, and this was a crash. @@ -572,15 +573,15 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: } // CHECK:STDOUT: %impl_witness.loc4: = impl_witness (), @impl.1(constants.%T) [symbolic = @impl.1.%impl_witness (constants.%impl_witness.1f09a1.1)] // CHECK:STDOUT: impl_decl @impl.2 [template] { -// CHECK:STDOUT: %T.patt.loc14_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt)] -// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc14_14.1, runtime_param [symbolic = %T.patt.loc14_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.patt.loc15_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc15_14.1, runtime_param [symbolic = %T.patt.loc15_14.2 (constants.%T.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc14_14.1 [symbolic = %T.loc14_14.2 (constants.%T)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc15_14.1 [symbolic = %T.loc15_14.2 (constants.%T)] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type] // CHECK:STDOUT: %T.param: type = value_param runtime_param -// CHECK:STDOUT: %T.loc14_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc14_14.2 (constants.%T)] +// CHECK:STDOUT: %T.loc15_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc15_14.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl_witness.loc14: = impl_witness (), @impl.2(constants.%T) [symbolic = @impl.2.%impl_witness (constants.%impl_witness.1f09a1.2)] +// CHECK:STDOUT: %impl_witness.loc15: = impl_witness (), @impl.2(constants.%T) [symbolic = @impl.2.%impl_witness (constants.%impl_witness.1f09a1.2)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -609,17 +610,17 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.2(%T.loc14_14.1: type) { -// CHECK:STDOUT: %T.loc14_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_14.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc14_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc14_14.2 (constants.%T.patt)] -// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.2(%T.loc14_14.2) [symbolic = %impl_witness (constants.%impl_witness.1f09a1.2)] +// CHECK:STDOUT: generic impl @impl.2(%T.loc15_14.1: type) { +// CHECK:STDOUT: %T.loc15_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc15_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc15_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.2(%T.loc15_14.2) [symbolic = %impl_witness (constants.%impl_witness.1f09a1.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %B.type: type = fn_type @B, @impl.2(%T.loc14_14.2) [symbolic = %B.type (constants.%B.type)] +// CHECK:STDOUT: %B.type: type = fn_type @B, @impl.2(%T.loc15_14.2) [symbolic = %B.type (constants.%B.type)] // CHECK:STDOUT: %B: @impl.2.%B.type (%B.type) = struct_value () [symbolic = %B (constants.%B)] -// CHECK:STDOUT: %C.type: type = fn_type @C, @impl.2(%T.loc14_14.2) [symbolic = %C.type (constants.%C.type)] +// CHECK:STDOUT: %C.type: type = fn_type @C, @impl.2(%T.loc15_14.2) [symbolic = %C.type (constants.%C.type)] // CHECK:STDOUT: %C: @impl.2.%C.type (%C.type) = struct_value () [symbolic = %C (constants.%C)] -// CHECK:STDOUT: %D.type: type = fn_type @D, @impl.2(%T.loc14_14.2) [symbolic = %D.type (constants.%D.type)] +// CHECK:STDOUT: %D.type: type = fn_type @D, @impl.2(%T.loc15_14.2) [symbolic = %D.type (constants.%D.type)] // CHECK:STDOUT: %D: @impl.2.%D.type (%D.type) = struct_value () [symbolic = %D (constants.%D)] // CHECK:STDOUT: // CHECK:STDOUT: impl: %T.ref as %I.ref { @@ -628,8 +629,8 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc18_14.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc18_14.2: type = converted %.loc18_14.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc19_14.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc19_14.2: type = converted %.loc19_14.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param0 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } @@ -637,8 +638,8 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc19_14.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc19_14.2: type = converted %.loc19_14.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc20_14.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc20_14.2: type = converted %.loc20_14.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param0 // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } @@ -647,7 +648,7 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: witness = file.%impl_witness.loc14 +// CHECK:STDOUT: witness = file.%impl_witness.loc15 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -660,7 +661,7 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @B(@impl.2.%T.loc14_14.1: type) { +// CHECK:STDOUT: generic fn @B(@impl.2.%T.loc15_14.1: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn() { @@ -669,36 +670,36 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @C(@impl.2.%T.loc14_14.1: type) { +// CHECK:STDOUT: generic fn @C(@impl.2.%T.loc15_14.1: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: fn() -> %empty_tuple.type { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc18_26: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc19_26: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc18_27: %empty_tuple.type = converted %.loc18_26, %empty_tuple [template = constants.%empty_tuple] -// CHECK:STDOUT: return %.loc18_27 +// CHECK:STDOUT: %.loc19_27: %empty_tuple.type = converted %.loc19_26, %empty_tuple [template = constants.%empty_tuple] +// CHECK:STDOUT: return %.loc19_27 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @D(@impl.2.%T.loc14_14.1: type) { +// CHECK:STDOUT: generic fn @D(@impl.2.%T.loc15_14.1: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %C.type: type = fn_type @C, @impl.2(%T) [symbolic = %C.type (constants.%C.type)] // CHECK:STDOUT: %C: @D.%C.type (%C.type) = struct_value () [symbolic = %C (constants.%C)] -// CHECK:STDOUT: %C.specific_fn.loc20_12.2: = specific_function %C, @C(%T) [symbolic = %C.specific_fn.loc20_12.2 (constants.%C.specific_fn)] +// CHECK:STDOUT: %C.specific_fn.loc21_12.2: = specific_function %C, @C(%T) [symbolic = %C.specific_fn.loc21_12.2 (constants.%C.specific_fn)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> %empty_tuple.type { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc20_12: @D.%C.type (%C.type) = specific_constant @impl.2.%C.decl, @impl.2(constants.%T) [symbolic = %C (constants.%C)] -// CHECK:STDOUT: %C.ref: @D.%C.type (%C.type) = name_ref C, %.loc20_12 [symbolic = %C (constants.%C)] -// CHECK:STDOUT: %C.specific_fn.loc20_12.1: = specific_function %C.ref, @C(constants.%T) [symbolic = %C.specific_fn.loc20_12.2 (constants.%C.specific_fn)] -// CHECK:STDOUT: %C.call: init %empty_tuple.type = call %C.specific_fn.loc20_12.1() -// CHECK:STDOUT: %.loc20_14.1: ref %empty_tuple.type = temporary_storage -// CHECK:STDOUT: %.loc20_14.2: ref %empty_tuple.type = temporary %.loc20_14.1, %C.call +// CHECK:STDOUT: %.loc21_12: @D.%C.type (%C.type) = specific_constant @impl.2.%C.decl, @impl.2(constants.%T) [symbolic = %C (constants.%C)] +// CHECK:STDOUT: %C.ref: @D.%C.type (%C.type) = name_ref C, %.loc21_12 [symbolic = %C (constants.%C)] +// CHECK:STDOUT: %C.specific_fn.loc21_12.1: = specific_function %C.ref, @C(constants.%T) [symbolic = %C.specific_fn.loc21_12.2 (constants.%C.specific_fn)] +// CHECK:STDOUT: %C.call: init %empty_tuple.type = call %C.specific_fn.loc21_12.1() +// CHECK:STDOUT: %.loc21_14.1: ref %empty_tuple.type = temporary_storage +// CHECK:STDOUT: %.loc21_14.2: ref %empty_tuple.type = temporary %.loc21_14.1, %C.call // CHECK:STDOUT: %tuple: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc20_15: %empty_tuple.type = converted %C.call, %tuple [template = constants.%empty_tuple] -// CHECK:STDOUT: return %.loc20_15 +// CHECK:STDOUT: %.loc21_15: %empty_tuple.type = converted %C.call, %tuple [template = constants.%empty_tuple] +// CHECK:STDOUT: return %.loc21_15 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -717,8 +718,8 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: specific @A(constants.%T) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.2(constants.%T) { -// CHECK:STDOUT: %T.loc14_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc14_14.2 => constants.%T +// CHECK:STDOUT: %T.loc15_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc15_14.2 => constants.%T // CHECK:STDOUT: %impl_witness => constants.%impl_witness.1f09a1.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -730,7 +731,7 @@ impl forall [T:! type] T as I { // CHECK:STDOUT: %D => constants.%D // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.2(%T.loc14_14.2) {} +// CHECK:STDOUT: specific @impl.2(%T.loc15_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @B(constants.%T) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/impl_assoc_const.carbon b/toolchain/check/testdata/impl/no_prelude/impl_assoc_const.carbon index 85327ab1b9d8..9920234e6479 100644 --- a/toolchain/check/testdata/impl/no_prelude/impl_assoc_const.carbon +++ b/toolchain/check/testdata/impl/no_prelude/impl_assoc_const.carbon @@ -132,13 +132,14 @@ library "[[@TEST_NAME]]"; interface L4 { let W4:! type; } -// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+7]]:27: error: name `BAD7` not found [NameNotFound] +// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+8]]:27: error: name `BAD7` not found [NameNotFound] // CHECK:STDERR: impl () as L4 where .W4 = BAD7 and .W4 = BAD8 {} // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+3]]:42: error: name `BAD8` not found [NameNotFound] +// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+4]]:42: error: name `BAD8` not found [NameNotFound] // CHECK:STDERR: impl () as L4 where .W4 = BAD7 and .W4 = BAD8 {} // CHECK:STDERR: ^~~~ +// CHECK:STDERR: impl () as L4 where .W4 = BAD7 and .W4 = BAD8 {} // --- repeated.carbon @@ -774,23 +775,23 @@ impl () as N where .Y = {.a = {}} { } // CHECK:STDOUT: } // CHECK:STDOUT: %L4.decl: type = interface_decl @L4 [template = constants.%L4.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { -// CHECK:STDOUT: %.loc12_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc12_7.2: type = converted %.loc12_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc13_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc13_7.2: type = converted %.loc13_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %L4.ref: type = name_ref L4, file.%L4.decl [template = constants.%L4.type] // CHECK:STDOUT: %.Self: %L4.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc12_21: %L4.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %W4.ref.loc12_21: %assoc_type = name_ref W4, @L4.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit.loc12_21: = facet_access_witness %.Self.ref.loc12_21 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0.loc12_21: type = impl_witness_access %.Self.as_wit.loc12_21, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %.Self.ref.loc13_21: %L4.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %W4.ref.loc13_21: %assoc_type = name_ref W4, @L4.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit.loc13_21: = facet_access_witness %.Self.ref.loc13_21 [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0.loc13_21: type = impl_witness_access %.Self.as_wit.loc13_21, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %BAD7.ref: = name_ref BAD7, [template = ] -// CHECK:STDOUT: %.Self.ref.loc12_36: %L4.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %W4.ref.loc12_36: %assoc_type = name_ref W4, @L4.%assoc0 [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit.loc12_36: = facet_access_witness %.Self.ref.loc12_36 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0.loc12_36: type = impl_witness_access %.Self.as_wit.loc12_36, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %.Self.ref.loc13_36: %L4.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %W4.ref.loc13_36: %assoc_type = name_ref W4, @L4.%assoc0 [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit.loc13_36: = facet_access_witness %.Self.ref.loc13_36 [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0.loc13_36: type = impl_witness_access %.Self.as_wit.loc13_36, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %BAD8.ref: = name_ref BAD8, [template = ] -// CHECK:STDOUT: %.loc12_15: type = where_expr %.Self [template = ] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc12_21, -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc12_36, +// CHECK:STDOUT: %.loc13_15: type = where_expr %.Self [template = ] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc13_21, +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc13_36, // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -806,7 +807,7 @@ impl () as N where .Y = {.a = {}} { } // CHECK:STDOUT: witness = (%W4) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc12_7.2 as %.loc12_15 { +// CHECK:STDOUT: impl @impl: %.loc13_7.2 as %.loc13_15 { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/impl_self_as.carbon b/toolchain/check/testdata/impl/no_prelude/impl_self_as.carbon index be455031a405..c7e6082cf19b 100644 --- a/toolchain/check/testdata/impl/no_prelude/impl_self_as.carbon +++ b/toolchain/check/testdata/impl/no_prelude/impl_self_as.carbon @@ -172,9 +172,10 @@ class C4(A:! type) { impl forall [B5:! type] as J5(B5); impl forall [B5:! type] C4(A) as J5(B5) {} - // CHECK:STDERR: fail_no_match.carbon:[[@LINE+3]]:3: error: impl declared but not defined [ImplMissingDefinition] + // CHECK:STDERR: fail_no_match.carbon:[[@LINE+4]]:3: error: impl declared but not defined [ImplMissingDefinition] // CHECK:STDERR: impl forall [B6:! type] Self as J6(B6); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: impl forall [B6:! type] Self as J6(B6); impl forall [B6:! type] C4(A) as J6(B6) {} } diff --git a/toolchain/check/testdata/impl/no_prelude/impl_where_redecl.carbon b/toolchain/check/testdata/impl/no_prelude/impl_where_redecl.carbon index ae50c1ca9090..b228186da227 100644 --- a/toolchain/check/testdata/impl/no_prelude/impl_where_redecl.carbon +++ b/toolchain/check/testdata/impl/no_prelude/impl_where_redecl.carbon @@ -50,8 +50,9 @@ library "[[@TEST_NAME]]"; interface L {} -// CHECK:STDERR: fail_other_nesting.carbon:[[@LINE+3]]:1: error: impl declared but not defined [ImplMissingDefinition] +// CHECK:STDERR: fail_other_nesting.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition] // CHECK:STDERR: impl () as (L where .Self impls type) where .Self impls type; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: impl () as (L where .Self impls type) where .Self impls type; impl () as L {} diff --git a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon index 78f78b0d77d6..b00d44131ed2 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon @@ -91,9 +91,10 @@ impl forall [T:! type] D as J(T) {} // CHECK:STDERR: impl forall [T:! type] D as J(T*); -// CHECK:STDERR: fail_import_generic_decl.impl.carbon:[[@LINE+3]]:1: error: redeclaration of imported impl [RedeclImportedImpl] +// CHECK:STDERR: fail_import_generic_decl.impl.carbon:[[@LINE+4]]:1: error: redeclaration of imported impl [RedeclImportedImpl] // CHECK:STDERR: impl forall [T:! type] D as J(T*) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: --- import_generic.carbon @@ -786,18 +787,18 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: } // CHECK:STDOUT: %impl_witness.loc20: = impl_witness (), @impl.5(constants.%T) [symbolic = @impl.5.%impl_witness (constants.%impl_witness.b80f53.2)] // CHECK:STDOUT: impl_decl @impl.6 [template] { -// CHECK:STDOUT: %T.patt.loc25_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc25_14.2 (constants.%T.patt)] -// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc25_14.1, runtime_param [symbolic = %T.patt.loc25_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.patt.loc26_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc26_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc26_14.1, runtime_param [symbolic = %T.patt.loc26_14.2 (constants.%T.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.b0a [template = constants.%D] // CHECK:STDOUT: %J.ref: %J.type.2b8 = name_ref J, imports.%import_ref.0eb [template = constants.%J.generic] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc25_14.1 [symbolic = %T.loc25_14.2 (constants.%T)] -// CHECK:STDOUT: %ptr.loc25_32.1: type = ptr_type %T [symbolic = %ptr.loc25_32.2 (constants.%ptr)] -// CHECK:STDOUT: %J.type.loc25_33.1: type = facet_type <@J, @J(constants.%ptr)> [symbolic = %J.type.loc25_33.2 (constants.%J.type.628)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc26_14.1 [symbolic = %T.loc26_14.2 (constants.%T)] +// CHECK:STDOUT: %ptr.loc26_32.1: type = ptr_type %T [symbolic = %ptr.loc26_32.2 (constants.%ptr)] +// CHECK:STDOUT: %J.type.loc26_33.1: type = facet_type <@J, @J(constants.%ptr)> [symbolic = %J.type.loc26_33.2 (constants.%J.type.628)] // CHECK:STDOUT: %T.param: type = value_param runtime_param -// CHECK:STDOUT: %T.loc25_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc25_14.2 (constants.%T)] +// CHECK:STDOUT: %T.loc26_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc26_14.2 (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl_witness.loc25: = impl_witness (), @impl.6(constants.%T) [symbolic = @impl.6.%impl_witness (constants.%impl_witness.b80f53.3)] +// CHECK:STDOUT: %impl_witness.loc26: = impl_witness (), @impl.6(constants.%T) [symbolic = @impl.6.%impl_witness (constants.%impl_witness.b80f53.3)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic interface @J(constants.%T: type) [from "fail_import_generic_decl.carbon"] { @@ -872,19 +873,19 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: impl: %D.ref as %J.type.loc20_33.1; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.6(%T.loc25_14.1: type) { -// CHECK:STDOUT: %T.loc25_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc25_14.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc25_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc25_14.2 (constants.%T.patt)] -// CHECK:STDOUT: %ptr.loc25_32.2: type = ptr_type @impl.6.%T.loc25_14.2 (%T) [symbolic = %ptr.loc25_32.2 (constants.%ptr)] -// CHECK:STDOUT: %J.type.loc25_33.2: type = facet_type <@J, @J(%ptr.loc25_32.2)> [symbolic = %J.type.loc25_33.2 (constants.%J.type.628)] -// CHECK:STDOUT: %require_complete: = require_complete_type @impl.6.%J.type.loc25_33.2 (%J.type.628) [symbolic = %require_complete (constants.%require_complete.c60)] -// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.6(%T.loc25_14.2) [symbolic = %impl_witness (constants.%impl_witness.b80f53.3)] +// CHECK:STDOUT: generic impl @impl.6(%T.loc26_14.1: type) { +// CHECK:STDOUT: %T.loc26_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc26_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc26_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc26_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %ptr.loc26_32.2: type = ptr_type @impl.6.%T.loc26_14.2 (%T) [symbolic = %ptr.loc26_32.2 (constants.%ptr)] +// CHECK:STDOUT: %J.type.loc26_33.2: type = facet_type <@J, @J(%ptr.loc26_32.2)> [symbolic = %J.type.loc26_33.2 (constants.%J.type.628)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.6.%J.type.loc26_33.2 (%J.type.628) [symbolic = %require_complete (constants.%require_complete.c60)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.6(%T.loc26_14.2) [symbolic = %impl_witness (constants.%impl_witness.b80f53.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: impl: %D.ref as %J.type.loc25_33.1 { +// CHECK:STDOUT: impl: %D.ref as %J.type.loc26_33.1 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%impl_witness.loc25 +// CHECK:STDOUT: witness = file.%impl_witness.loc26 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -975,15 +976,15 @@ impl forall [T:! type] D as J(T*) {} // CHECK:STDOUT: specific @impl.5(%T.loc20_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.6(constants.%T) { -// CHECK:STDOUT: %T.loc25_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc25_14.2 => constants.%T -// CHECK:STDOUT: %ptr.loc25_32.2 => constants.%ptr -// CHECK:STDOUT: %J.type.loc25_33.2 => constants.%J.type.628 +// CHECK:STDOUT: %T.loc26_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc26_14.2 => constants.%T +// CHECK:STDOUT: %ptr.loc26_32.2 => constants.%ptr +// CHECK:STDOUT: %J.type.loc26_33.2 => constants.%J.type.628 // CHECK:STDOUT: %require_complete => constants.%require_complete.c60 // CHECK:STDOUT: %impl_witness => constants.%impl_witness.b80f53.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @J(@impl.6.%ptr.loc25_32.2) {} +// CHECK:STDOUT: specific @J(@impl.6.%ptr.loc26_32.2) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.6(%T.loc25_14.2) {} +// CHECK:STDOUT: specific @impl.6(%T.loc26_14.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/import_interface_assoc_const.carbon b/toolchain/check/testdata/impl/no_prelude/import_interface_assoc_const.carbon index 14dad150eff6..09c113e958af 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_interface_assoc_const.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_interface_assoc_const.carbon @@ -148,13 +148,14 @@ import library "interface"; class CA { } -// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+7]]:25: error: name `BAD7` not found [NameNotFound] +// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+8]]:25: error: name `BAD7` not found [NameNotFound] // CHECK:STDERR: impl CA as I where .T = BAD7 and .T = BAD8 { } // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+3]]:39: error: name `BAD8` not found [NameNotFound] +// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+4]]:39: error: name `BAD8` not found [NameNotFound] // CHECK:STDERR: impl CA as I where .T = BAD7 and .T = BAD8 { } // CHECK:STDERR: ^~~~ +// CHECK:STDERR: impl CA as I where .T = BAD7 and .T = BAD8 { } // --- repeated.carbon @@ -994,19 +995,19 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: %CA.ref: type = name_ref CA, file.%CA.decl [template = constants.%CA] // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.df2 [template = constants.%I.type] // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc13_20: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %T.ref.loc13_20: %assoc_type = name_ref T, imports.%import_ref.15c [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit.loc13_20: = facet_access_witness %.Self.ref.loc13_20 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0.loc13_20: type = impl_witness_access %.Self.as_wit.loc13_20, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %.Self.ref.loc14_20: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %T.ref.loc14_20: %assoc_type = name_ref T, imports.%import_ref.15c [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit.loc14_20: = facet_access_witness %.Self.ref.loc14_20 [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0.loc14_20: type = impl_witness_access %.Self.as_wit.loc14_20, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %BAD7.ref: = name_ref BAD7, [template = ] -// CHECK:STDOUT: %.Self.ref.loc13_34: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self] -// CHECK:STDOUT: %T.ref.loc13_34: %assoc_type = name_ref T, imports.%import_ref.15c [template = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_wit.loc13_34: = facet_access_witness %.Self.ref.loc13_34 [symbolic = constants.%.Self.as_wit] -// CHECK:STDOUT: %impl.elem0.loc13_34: type = impl_witness_access %.Self.as_wit.loc13_34, element0 [symbolic = constants.%impl.elem0] +// CHECK:STDOUT: %.Self.ref.loc14_34: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self] +// CHECK:STDOUT: %T.ref.loc14_34: %assoc_type = name_ref T, imports.%import_ref.15c [template = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_wit.loc14_34: = facet_access_witness %.Self.ref.loc14_34 [symbolic = constants.%.Self.as_wit] +// CHECK:STDOUT: %impl.elem0.loc14_34: type = impl_witness_access %.Self.as_wit.loc14_34, element0 [symbolic = constants.%impl.elem0] // CHECK:STDOUT: %BAD8.ref: = name_ref BAD8, [template = ] -// CHECK:STDOUT: %.loc13: type = where_expr %.Self [template = ] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc13_20, -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc13_34, +// CHECK:STDOUT: %.loc14: type = where_expr %.Self [template = ] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc14_20, +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc14_34, // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1018,7 +1019,7 @@ impl CC as NonType where .Y = {.a = {}} { } // CHECK:STDOUT: witness = (imports.%import_ref.08d) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %CA.ref as %.loc13 { +// CHECK:STDOUT: impl @impl: %CA.ref as %.loc14 { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon b/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon index 499a877374bd..847026a73723 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon @@ -30,13 +30,14 @@ import library "import_generic"; var c: C({}) = {}; // We're just checking that this doesn't crash. It's not expected to compile. -// CHECK:STDERR: fail_use_in_fn_decl.carbon:[[@LINE+7]]:11: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound] +// CHECK:STDERR: fail_use_in_fn_decl.carbon:[[@LINE+8]]:11: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound] // CHECK:STDERR: fn F() -> c.(I.F)() {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_use_in_fn_decl.carbon:[[@LINE+3]]:22: error: missing `return` at end of function with declared return type [MissingReturnStatement] +// CHECK:STDERR: fail_use_in_fn_decl.carbon:[[@LINE+4]]:22: error: missing `return` at end of function with declared return type [MissingReturnStatement] // CHECK:STDERR: fn F() -> c.(I.F)() {} // CHECK:STDERR: ^ +// CHECK:STDERR: fn F() -> c.(I.F)() {} // CHECK:STDOUT: --- import_generic.carbon @@ -233,9 +234,9 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: %impl.elem0: %F.type.cf0 = impl_witness_access constants.%impl_witness.02b, element0 [template = constants.%F.9e6] // CHECK:STDOUT: %F.specific_fn: = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [template = constants.%F.specific_fn] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn() -// CHECK:STDOUT: %.loc15_19.1: ref %empty_tuple.type = temporary_storage -// CHECK:STDOUT: %.loc15_19.2: ref %empty_tuple.type = temporary %.loc15_19.1, %F.call -// CHECK:STDOUT: %.loc15_19.3: type = converted %F.call, [template = ] +// CHECK:STDOUT: %.loc16_19.1: ref %empty_tuple.type = temporary_storage +// CHECK:STDOUT: %.loc16_19.2: ref %empty_tuple.type = temporary %.loc16_19.1, %F.call +// CHECK:STDOUT: %.loc16_19.3: type = converted %F.call, [template = ] // CHECK:STDOUT: %return.param: ref = out_param runtime_param0 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon index 45e97612021e..277dc4bab0ba 100644 --- a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon +++ b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon @@ -72,9 +72,10 @@ impl library "[[@TEST_NAME]]"; class C {} fn MakeC(a: A) -> C { - // CHECK:STDERR: fail_factory.impl.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Factory(C)` in type `A` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_factory.impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Factory(C)` in type `A` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return a.(Factory(C).Make)(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: return a.(Factory(C).Make)(); } @@ -965,10 +966,10 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %Factory.ref: %Factory.type.1a8 = name_ref Factory, imports.%import_ref.e3d [template = constants.%Factory.generic] -// CHECK:STDOUT: %C.ref.loc10: type = name_ref C, file.%C.decl [template = constants.%C] +// CHECK:STDOUT: %C.ref.loc11: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%C)> [template = constants.%Factory.type.5c5] -// CHECK:STDOUT: %.loc10: %Make.assoc_type.2ea = specific_constant imports.%import_ref.b0a, @Factory(constants.%C) [template = constants.%assoc0.9a3] -// CHECK:STDOUT: %Make.ref: %Make.assoc_type.2ea = name_ref Make, %.loc10 [template = constants.%assoc0.9a3] +// CHECK:STDOUT: %.loc11: %Make.assoc_type.2ea = specific_constant imports.%import_ref.b0a, @Factory(constants.%C) [template = constants.%assoc0.9a3] +// CHECK:STDOUT: %Make.ref: %Make.assoc_type.2ea = name_ref Make, %.loc11 [template = constants.%assoc0.9a3] // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon index b6ae66928c72..66a70b472160 100644 --- a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon @@ -94,9 +94,10 @@ impl library "[[@TEST_NAME]]"; interface D {} -// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: error: impl declared but not defined [ImplMissingDefinition] +// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition] // CHECK:STDERR: impl () as D; // CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: impl () as D; // CHECK:STDOUT: --- fail_decl_in_api_definition_in_impl.carbon @@ -357,8 +358,8 @@ impl () as D; // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %D.decl: type = interface_decl @D [template = constants.%D.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { -// CHECK:STDOUT: %.loc9_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc10_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D.type] // CHECK:STDOUT: } // CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] @@ -372,5 +373,5 @@ impl () as D; // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc9_7.2 as %D.ref; +// CHECK:STDOUT: impl @impl: %.loc10_7.2 as %D.ref; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index 18f4324de0e4..f3f8f8db882a 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -16,9 +16,10 @@ var a: [i32; 1] = (12,); // CHECK:STDERR: var b: i32 = a[1]; -// CHECK:STDERR: fail_array_large_index.carbon:[[@LINE+3]]:16: error: array index `2147483647` is past the end of type `[i32; 1]` [ArrayIndexOutOfBounds] +// CHECK:STDERR: fail_array_large_index.carbon:[[@LINE+4]]:16: error: array index `2147483647` is past the end of type `[i32; 1]` [ArrayIndexOutOfBounds] // CHECK:STDERR: var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDERR: ^~~~~~~~~~~ +// CHECK:STDERR: var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: --- fail_array_large_index.carbon @@ -101,19 +102,19 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %.loc17_17.1: ref %i32 = array_index %a.ref.loc17, %.loc17_16.2 [template = ] // CHECK:STDOUT: %.loc17_17.2: %i32 = bind_value %.loc17_17.1 // CHECK:STDOUT: assign file.%b.var, %.loc17_17.2 -// CHECK:STDOUT: %a.ref.loc22: ref %array_type = name_ref a, file.%a +// CHECK:STDOUT: %a.ref.loc23: ref %array_type = name_ref a, file.%a // CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.d89] -// CHECK:STDOUT: %int_32.loc22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc22: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc22: = bound_method %int_2147483647, %impl.elem0.loc22 [template = constants.%Convert.bound.f38] -// CHECK:STDOUT: %Convert.specific_fn.loc22: = specific_function %Convert.bound.loc22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.221] -// CHECK:STDOUT: %int.convert_checked.loc22: init %i32 = call %Convert.specific_fn.loc22(%int_2147483647) [template = constants.%int_2147483647.a74] -// CHECK:STDOUT: %.loc22_16.1: %i32 = value_of_initializer %int.convert_checked.loc22 [template = constants.%int_2147483647.a74] -// CHECK:STDOUT: %.loc22_16.2: %i32 = converted %int_2147483647, %.loc22_16.1 [template = constants.%int_2147483647.a74] -// CHECK:STDOUT: %.loc22_27.1: ref %i32 = array_index %a.ref.loc22, %.loc22_16.2 [template = ] -// CHECK:STDOUT: %.loc22_27.2: %i32 = bind_value %.loc22_27.1 -// CHECK:STDOUT: assign file.%c.var, %.loc22_27.2 +// CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc23: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc23: = bound_method %int_2147483647, %impl.elem0.loc23 [template = constants.%Convert.bound.f38] +// CHECK:STDOUT: %Convert.specific_fn.loc23: = specific_function %Convert.bound.loc23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.221] +// CHECK:STDOUT: %int.convert_checked.loc23: init %i32 = call %Convert.specific_fn.loc23(%int_2147483647) [template = constants.%int_2147483647.a74] +// CHECK:STDOUT: %.loc23_16.1: %i32 = value_of_initializer %int.convert_checked.loc23 [template = constants.%int_2147483647.a74] +// CHECK:STDOUT: %.loc23_16.2: %i32 = converted %int_2147483647, %.loc23_16.1 [template = constants.%int_2147483647.a74] +// CHECK:STDOUT: %.loc23_27.1: ref %i32 = array_index %a.ref.loc23, %.loc23_16.2 [template = ] +// CHECK:STDOUT: %.loc23_27.2: %i32 = bind_value %.loc23_27.1 +// CHECK:STDOUT: assign file.%c.var, %.loc23_27.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index f0723579d0a0..808be111c5f4 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -9,12 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_array_non_int_indexing.carbon var a: [i32; 1] = (12,); -// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+6]]:16: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+7]]:16: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: var b: i32 = a[2.6]; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+3]]:16: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+4]]:16: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var b: i32 = a[2.6]; // CHECK:STDERR: ^~~ +// CHECK:STDERR: var b: i32 = a[2.6]; // CHECK:STDOUT: --- fail_array_non_int_indexing.carbon @@ -79,10 +80,10 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %float: f64 = float_literal 2.6000000000000001 [template = constants.%float] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc18_16: %i32 = converted %float, [template = ] -// CHECK:STDOUT: %.loc18_19.1: ref %i32 = array_index %a.ref, [template = ] -// CHECK:STDOUT: %.loc18_19.2: %i32 = bind_value %.loc18_19.1 -// CHECK:STDOUT: assign file.%b.var, %.loc18_19.2 +// CHECK:STDOUT: %.loc19_16: %i32 = converted %float, [template = ] +// CHECK:STDOUT: %.loc19_19.1: ref %i32 = array_index %a.ref, [template = ] +// CHECK:STDOUT: %.loc19_19.2: %i32 = bind_value %.loc19_19.1 +// CHECK:STDOUT: assign file.%b.var, %.loc19_19.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon index 64270ca8a645..1fc58a050133 100644 --- a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon var a: [i32; 1] = (12,); -// CHECK:STDERR: fail_array_out_of_bound_access.carbon:[[@LINE+3]]:16: error: array index `1` is past the end of type `[i32; 1]` [ArrayIndexOutOfBounds] +// CHECK:STDERR: fail_array_out_of_bound_access.carbon:[[@LINE+4]]:16: error: array index `1` is past the end of type `[i32; 1]` [ArrayIndexOutOfBounds] // CHECK:STDERR: var b: i32 = a[1]; // CHECK:STDERR: ^ +// CHECK:STDERR: var b: i32 = a[1]; // CHECK:STDOUT: --- fail_array_out_of_bound_access.carbon @@ -78,15 +79,15 @@ var b: i32 = a[1]; // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_1, %impl.elem0.loc15 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_1) [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc15_16.1: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc15_16.2: %i32 = converted %int_1, %.loc15_16.1 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc15_17.1: ref %i32 = array_index %a.ref, %.loc15_16.2 [template = ] -// CHECK:STDOUT: %.loc15_17.2: %i32 = bind_value %.loc15_17.1 -// CHECK:STDOUT: assign file.%b.var, %.loc15_17.2 +// CHECK:STDOUT: %impl.elem0.loc16: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int_1, %impl.elem0.loc16 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc16_16.1: %i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc16_16.2: %i32 = converted %int_1, %.loc16_16.1 [template = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc16_17.1: ref %i32 = array_index %a.ref, %.loc16_16.2 [template = ] +// CHECK:STDOUT: %.loc16_17.2: %i32 = bind_value %.loc16_17.1 +// CHECK:STDOUT: assign file.%b.var, %.loc16_17.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index 047f32ce5406..e8f89618b231 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -30,9 +30,10 @@ fn G(b: [i32; 3]) { // CHECK:STDERR: ^ // CHECK:STDERR: var pf: i32* = &F()[0]; - // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+3]]:3: error: expression is not assignable [AssignmentToNonAssignable] + // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:3: error: expression is not assignable [AssignmentToNonAssignable] // CHECK:STDERR: F()[0] = 4; // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: F()[0] = 4; } @@ -164,28 +165,28 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %.loc32_24.2: %i32 = bind_value %.loc32_24.1 // CHECK:STDOUT: %addr.loc32: %ptr.235 = addr_of [template = ] // CHECK:STDOUT: assign %pf.var, %addr.loc32 -// CHECK:STDOUT: %F.ref.loc36: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc36_5.1: ref %array_type = temporary_storage -// CHECK:STDOUT: %F.call.loc36: init %array_type = call %F.ref.loc36() to %.loc36_5.1 -// CHECK:STDOUT: %int_0.loc36: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %.loc36_5.2: ref %array_type = temporary %.loc36_5.1, %F.call.loc36 -// CHECK:STDOUT: %int_32.loc36: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc36: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc36_7: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc36_7: = bound_method %int_0.loc36, %impl.elem0.loc36_7 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc36_7: = specific_function %Convert.bound.loc36_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc36_7: init %i32 = call %Convert.specific_fn.loc36_7(%int_0.loc36) [template = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc36_7.1: %i32 = value_of_initializer %int.convert_checked.loc36_7 [template = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc36_7.2: %i32 = converted %int_0.loc36, %.loc36_7.1 [template = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc36_8.1: ref %i32 = array_index %.loc36_5.2, %.loc36_7.2 -// CHECK:STDOUT: %.loc36_8.2: %i32 = bind_value %.loc36_8.1 -// CHECK:STDOUT: %int_4.loc36: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] -// CHECK:STDOUT: %impl.elem0.loc36_10: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc36_10: = bound_method %int_4.loc36, %impl.elem0.loc36_10 [template = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %Convert.specific_fn.loc36_10: = specific_function %Convert.bound.loc36_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] -// CHECK:STDOUT: %int.convert_checked.loc36_10: init %i32 = call %Convert.specific_fn.loc36_10(%int_4.loc36) [template = constants.%int_4.940] -// CHECK:STDOUT: %.loc36_10: init %i32 = converted %int_4.loc36, %int.convert_checked.loc36_10 [template = constants.%int_4.940] -// CHECK:STDOUT: assign %.loc36_8.2, %.loc36_10 +// CHECK:STDOUT: %F.ref.loc37: %F.type = name_ref F, file.%F.decl [template = constants.%F] +// CHECK:STDOUT: %.loc37_5.1: ref %array_type = temporary_storage +// CHECK:STDOUT: %F.call.loc37: init %array_type = call %F.ref.loc37() to %.loc37_5.1 +// CHECK:STDOUT: %int_0.loc37: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] +// CHECK:STDOUT: %.loc37_5.2: ref %array_type = temporary %.loc37_5.1, %F.call.loc37 +// CHECK:STDOUT: %int_32.loc37: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc37_7: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc37_7: = bound_method %int_0.loc37, %impl.elem0.loc37_7 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %Convert.specific_fn.loc37_7: = specific_function %Convert.bound.loc37_7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc37_7: init %i32 = call %Convert.specific_fn.loc37_7(%int_0.loc37) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc37_7.1: %i32 = value_of_initializer %int.convert_checked.loc37_7 [template = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc37_7.2: %i32 = converted %int_0.loc37, %.loc37_7.1 [template = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc37_8.1: ref %i32 = array_index %.loc37_5.2, %.loc37_7.2 +// CHECK:STDOUT: %.loc37_8.2: %i32 = bind_value %.loc37_8.1 +// CHECK:STDOUT: %int_4.loc37: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1] +// CHECK:STDOUT: %impl.elem0.loc37_10: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc37_10: = bound_method %int_4.loc37, %impl.elem0.loc37_10 [template = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %Convert.specific_fn.loc37_10: = specific_function %Convert.bound.loc37_10, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.450] +// CHECK:STDOUT: %int.convert_checked.loc37_10: init %i32 = call %Convert.specific_fn.loc37_10(%int_4.loc37) [template = constants.%int_4.940] +// CHECK:STDOUT: %.loc37_10: init %i32 = converted %int_4.loc37, %int.convert_checked.loc37_10 [template = constants.%int_4.940] +// CHECK:STDOUT: assign %.loc37_8.2, %.loc37_10 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_invalid_base.carbon b/toolchain/check/testdata/index/fail_invalid_base.carbon index 32b9b3839b7f..3e5ca5f042f9 100644 --- a/toolchain/check/testdata/index/fail_invalid_base.carbon +++ b/toolchain/check/testdata/index/fail_invalid_base.carbon @@ -28,9 +28,10 @@ var b: i32 = F[1]; // CHECK:STDERR: var c: i32 = {.a = 1, .b = 2}[0]; -// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+3]]:14: error: type `type` does not support indexing [TypeNotIndexable] +// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+4]]:14: error: type `type` does not support indexing [TypeNotIndexable] // CHECK:STDERR: var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: --- fail_invalid_base.carbon @@ -97,12 +98,12 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: %struct: %struct_type.a.b.cfd = struct_value (%int_1.loc29, %int_2) [template = constants.%struct] // CHECK:STDOUT: %.loc29_29.2: %struct_type.a.b.cfd = converted %.loc29_29.1, %struct [template = constants.%struct] // CHECK:STDOUT: assign file.%c.var, -// CHECK:STDOUT: %int_32.loc34_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc34_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %int_32.loc34_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc34_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc35_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc35_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc35_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc35_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.501] -// CHECK:STDOUT: %int_0.loc34: Core.IntLiteral = int_value 0 [template = constants.%int_0] +// CHECK:STDOUT: %int_0.loc35: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: assign file.%d.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_name_not_found.carbon b/toolchain/check/testdata/index/fail_name_not_found.carbon index 91da6b8a04e5..53c59cc511de 100644 --- a/toolchain/check/testdata/index/fail_name_not_found.carbon +++ b/toolchain/check/testdata/index/fail_name_not_found.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_name_not_found.carbon fn Main() { - // CHECK:STDERR: fail_name_not_found.carbon:[[@LINE+3]]:16: error: name `a` not found [NameNotFound] + // CHECK:STDERR: fail_name_not_found.carbon:[[@LINE+4]]:16: error: name `a` not found [NameNotFound] // CHECK:STDERR: var b: i32 = a[0]; // CHECK:STDERR: ^ + // CHECK:STDERR: var b: i32 = a[0]; } diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 26754bab164a..9f3f95e5a3dc 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_negative_indexing.carbon var c: [i32; 2] = (42, 42); -// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:16: error: array index `-10` is past the end of type `[i32; 2]` [ArrayIndexOutOfBounds] +// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+4]]:16: error: array index `-10` is past the end of type `[i32; 2]` [ArrayIndexOutOfBounds] // CHECK:STDERR: var d: i32 = c[-10]; // CHECK:STDERR: ^~~ +// CHECK:STDERR: var d: i32 = c[-10]; @@ -95,22 +96,22 @@ var d: i32 = c[-10]; // CHECK:STDOUT: assign file.%c.var, %.loc11_27 // CHECK:STDOUT: %c.ref: ref %array_type = name_ref c, file.%c // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10] -// CHECK:STDOUT: %impl.elem0.loc15_16.1: %Op.type.e42 = impl_witness_access constants.%impl_witness.0f6, element0 [template = constants.%Op.bba] -// CHECK:STDOUT: %Op.bound: = bound_method %int_10, %impl.elem0.loc15_16.1 [template = constants.%Op.bound] +// CHECK:STDOUT: %impl.elem0.loc16_16.1: %Op.type.e42 = impl_witness_access constants.%impl_witness.0f6, element0 [template = constants.%Op.bba] +// CHECK:STDOUT: %Op.bound: = bound_method %int_10, %impl.elem0.loc16_16.1 [template = constants.%Op.bound] // CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %Op.bound(%int_10) [template = constants.%int_-10.06d] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc15_16.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int.snegate, %impl.elem0.loc15_16.2 [template = constants.%Convert.bound.1ca] -// CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4be] -// CHECK:STDOUT: %.loc15_16.1: Core.IntLiteral = value_of_initializer %int.snegate [template = constants.%int_-10.06d] -// CHECK:STDOUT: %.loc15_16.2: Core.IntLiteral = converted %int.snegate, %.loc15_16.1 [template = constants.%int_-10.06d] -// CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%.loc15_16.2) [template = constants.%int_-10.c17] -// CHECK:STDOUT: %.loc15_16.3: %i32 = value_of_initializer %int.convert_checked.loc15 [template = constants.%int_-10.c17] -// CHECK:STDOUT: %.loc15_16.4: %i32 = converted %int.snegate, %.loc15_16.3 [template = constants.%int_-10.c17] -// CHECK:STDOUT: %.loc15_19.1: ref %i32 = array_index %c.ref, %.loc15_16.4 [template = ] -// CHECK:STDOUT: %.loc15_19.2: %i32 = bind_value %.loc15_19.1 -// CHECK:STDOUT: assign file.%d.var, %.loc15_19.2 +// CHECK:STDOUT: %impl.elem0.loc16_16.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc16: = bound_method %int.snegate, %impl.elem0.loc16_16.2 [template = constants.%Convert.bound.1ca] +// CHECK:STDOUT: %Convert.specific_fn.loc16: = specific_function %Convert.bound.loc16, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4be] +// CHECK:STDOUT: %.loc16_16.1: Core.IntLiteral = value_of_initializer %int.snegate [template = constants.%int_-10.06d] +// CHECK:STDOUT: %.loc16_16.2: Core.IntLiteral = converted %int.snegate, %.loc16_16.1 [template = constants.%int_-10.06d] +// CHECK:STDOUT: %int.convert_checked.loc16: init %i32 = call %Convert.specific_fn.loc16(%.loc16_16.2) [template = constants.%int_-10.c17] +// CHECK:STDOUT: %.loc16_16.3: %i32 = value_of_initializer %int.convert_checked.loc16 [template = constants.%int_-10.c17] +// CHECK:STDOUT: %.loc16_16.4: %i32 = converted %int.snegate, %.loc16_16.3 [template = constants.%int_-10.c17] +// CHECK:STDOUT: %.loc16_19.1: ref %i32 = array_index %c.ref, %.loc16_16.4 [template = ] +// CHECK:STDOUT: %.loc16_19.2: %i32 = bind_value %.loc16_19.1 +// CHECK:STDOUT: assign file.%d.var, %.loc16_19.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_non_tuple_access.carbon b/toolchain/check/testdata/index/fail_non_tuple_access.carbon index 03f502c7f074..65de4b87eefc 100644 --- a/toolchain/check/testdata/index/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/index/fail_non_tuple_access.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_non_tuple_access.carbon fn Main() { - // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+3]]:3: error: type `Core.IntLiteral` does not support indexing [TypeNotIndexable] + // 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]; } diff --git a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon index e060586e23d3..398347e5b6dd 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon @@ -9,12 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon interface I { - // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: let T:! type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+3]]:3: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+4]]:3: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: let T:! type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: let T:! type = 42; } @@ -48,7 +49,7 @@ interface I { // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42] -// CHECK:STDOUT: %.loc18: type = converted %int_42, [template = ] +// CHECK:STDOUT: %.loc19: type = converted %int_42, [template = ] // CHECK:STDOUT: %T: type = assoc_const_decl T [template] // CHECK:STDOUT: %assoc0: %assoc_type = assoc_entity element0, %T [template = constants.%assoc0.790] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon index b84ac4975708..82c31a509ade 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -14,9 +14,10 @@ interface I { // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default let T:! type = (i32, i32); - // CHECK:STDERR: fail_todo_assoc_const_default.carbon:[[@LINE+3]]:3: error: semantics TODO: `interface modifier` [SemanticsTodo] + // CHECK:STDERR: fail_todo_assoc_const_default.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` [SemanticsTodo] // CHECK:STDERR: default let N:! i32 = 42; // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: default let N:! i32 = 42; } @@ -76,8 +77,8 @@ interface I { // CHECK:STDOUT: %Convert.bound: = bound_method %int_42, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_42) [template = constants.%int_42.c68] -// CHECK:STDOUT: %.loc20_27.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_42.c68] -// CHECK:STDOUT: %.loc20_27.2: %i32 = converted %int_42, %.loc20_27.1 [template = constants.%int_42.c68] +// CHECK:STDOUT: %.loc21_27.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_42.c68] +// CHECK:STDOUT: %.loc21_27.2: %i32 = converted %int_42, %.loc21_27.1 [template = constants.%int_42.c68] // CHECK:STDOUT: %N: %i32 = assoc_const_decl N [template] // CHECK:STDOUT: %assoc1: %assoc_type.4fb = assoc_entity element1, %N [template = constants.%assoc1] // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon index c491ec7ad4db..7848c1cc0125 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon @@ -15,9 +15,10 @@ interface Interface { // CHECK:STDERR: default fn F() {} - // CHECK:STDERR: fail_todo_define_default_fn_inline.carbon:[[@LINE+3]]:3: error: semantics TODO: `interface modifier` [SemanticsTodo] + // CHECK:STDERR: fail_todo_define_default_fn_inline.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` [SemanticsTodo] // CHECK:STDERR: default fn G(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: default fn G(a: i32, b: i32) -> i32 = "int.sadd"; } @@ -67,18 +68,18 @@ interface Interface { // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc21_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc22_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc22_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc21_19: type = splice_block %i32.loc21_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc21_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_19: type = splice_block %i32.loc22_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc22_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc22_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc21_27: type = splice_block %i32.loc21_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc21_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc21_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc22_27: type = splice_block %i32.loc22_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc22_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc22_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index e2500b65e35d..c8c608ccf8ef 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -33,12 +33,13 @@ interface Interface { // CHECK:STDERR: fn Interface.F() {} -// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+6]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] +// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: fn Interface.G(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE-15]]:3: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: default fn G(a: i32, b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Interface.G(a: i32, b: i32) -> i32 = "int.sadd"; // --- dependent_return_type.carbon @@ -100,7 +101,7 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%Interface.type] {} {} // CHECK:STDOUT: %.decl.loc23: %.type.136624.1 = fn_decl @.1 [template = constants.%.563abc.1] {} {} -// CHECK:STDOUT: %.decl.loc31: %.type.136624.2 = fn_decl @.2 [template = constants.%.563abc.2] { +// CHECK:STDOUT: %.decl.loc32: %.type.136624.2 = fn_decl @.2 [template = constants.%.563abc.2] { // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b @@ -108,18 +109,18 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc31_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc31_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %int_32.loc32_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc32_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc31_19: type = splice_block %i32.loc31_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc31_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc31_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc32_19: type = splice_block %i32.loc32_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc32_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc32_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc31_27: type = splice_block %i32.loc31_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc31_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc31_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %.loc32_27: type = splice_block %i32.loc32_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc32_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc32_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: } // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 diff --git a/toolchain/check/testdata/interface/member_lookup.carbon b/toolchain/check/testdata/interface/member_lookup.carbon index a239317c1eb4..7c7a57d9a8a2 100644 --- a/toolchain/check/testdata/interface/member_lookup.carbon +++ b/toolchain/check/testdata/interface/member_lookup.carbon @@ -41,9 +41,10 @@ fn AccessMissingGeneric[T:! type](I:! Interface(T)) -> T { } fn AccessMissingConcrete(I:! Interface(i32)) -> i32 { - // CHECK:STDERR: fail_no_member.carbon:[[@LINE+3]]:10: error: member name `nonesuch` not found in `Interface(i32)` [MemberNameNotFoundInScope] + // CHECK:STDERR: fail_no_member.carbon:[[@LINE+4]]:10: error: member name `nonesuch` not found in `Interface(i32)` [MemberNameNotFoundInScope] // CHECK:STDERR: return I.nonesuch; // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: return I.nonesuch; } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon b/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon index 1be6348f5b77..719ac3e89f8b 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon @@ -25,9 +25,10 @@ interface Outer { // CHECK:STDERR: fn Outer.F(); } - // CHECK:STDERR: fail_add_member_outside_definition.carbon:[[@LINE+3]]:12: error: out-of-line declaration requires a declaration in scoped entity [QualifiedDeclOutsideScopeEntity] + // CHECK:STDERR: fail_add_member_outside_definition.carbon:[[@LINE+4]]:12: error: out-of-line declaration requires a declaration in scoped entity [QualifiedDeclOutsideScopeEntity] // CHECK:STDERR: fn Inner.F(); // CHECK:STDERR: ^ + // CHECK:STDERR: fn Inner.F(); } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon index 1667a902d502..fd13758d8057 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon interface I { - // CHECK:STDERR: fail_assoc_const_not_binding.carbon:[[@LINE+3]]:3: error: semantics TODO: `tuple pattern in let/var` [SemanticsTodo] + // CHECK:STDERR: fail_assoc_const_not_binding.carbon:[[@LINE+4]]:3: error: semantics TODO: `tuple pattern in let/var` [SemanticsTodo] // CHECK:STDERR: let (T:! type, U:! type); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: let (T:! type, U:! type); } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon index 30f3ed7a5e2b..2e45b27a0801 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon @@ -9,13 +9,14 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon interface I { - // CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+7]]:10: error: `Core.Int` implicitly referenced here, but package `Core` not found [CoreNotFound] + // CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+8]]:10: error: `Core.Int` implicitly referenced here, but package `Core` not found [CoreNotFound] // CHECK:STDERR: let a: i32; // CHECK:STDERR: ^~~ // CHECK:STDERR: - // CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+3]]:7: error: pattern in associated constant declaration must be a single `:!` binding [ExpectedSymbolicBindingInAssociatedConstant] + // CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+4]]:7: error: pattern in associated constant declaration must be a single `:!` binding [ExpectedSymbolicBindingInAssociatedConstant] // CHECK:STDERR: let a: i32; // CHECK:STDERR: ^ + // CHECK:STDERR: let a: i32; } @@ -39,10 +40,10 @@ alias UseOther = I.other; // CHECK:STDOUT: .UseOther = %UseOther // CHECK:STDOUT: } // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {} -// CHECK:STDOUT: %I.ref.loc23: type = name_ref I, %I.decl [template = constants.%I.type] +// CHECK:STDOUT: %I.ref.loc24: type = name_ref I, %I.decl [template = constants.%I.type] // CHECK:STDOUT: %a.ref: = name_ref a, [template = ] // CHECK:STDOUT: %UseA: = bind_alias UseA, [template = ] -// CHECK:STDOUT: %I.ref.loc26: type = name_ref I, %I.decl [template = constants.%I.type] +// CHECK:STDOUT: %I.ref.loc27: type = name_ref I, %I.decl [template = constants.%I.type] // CHECK:STDOUT: %other.ref: = name_ref other, [template = ] // CHECK:STDOUT: %UseOther: = bind_alias UseOther, [template = ] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon index 1cd44210feb9..b6a222e8fac9 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon interface I { - // CHECK:STDERR: fail_assoc_const_template.carbon:[[@LINE+3]]:7: error: semantics TODO: `HandleTemplate` [SemanticsTodo] + // CHECK:STDERR: fail_assoc_const_template.carbon:[[@LINE+4]]:7: error: semantics TODO: `HandleTemplate` [SemanticsTodo] // CHECK:STDERR: let template T:! type; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ + // CHECK:STDERR: let template T:! type; } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon b/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon index 9bb021a516f1..9b072163dd65 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon @@ -19,13 +19,14 @@ interface I; library "[[@TEST_NAME]]"; import library "a"; -// CHECK:STDERR: fail_b.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] +// CHECK:STDERR: fail_b.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: interface I {} // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_b.carbon:[[@LINE-5]]:1: in import [InImport] // CHECK:STDERR: a.carbon:4:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: interface I; // CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: interface I {} // CHECK:STDOUT: --- a.carbon diff --git a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon index e5a11e438abe..befc87f9b1ab 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon @@ -61,12 +61,13 @@ interface Function; class Class; -// CHECK:STDERR: fail_name_conflict_with_class.carbon:[[@LINE+6]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] +// CHECK:STDERR: fail_name_conflict_with_class.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: interface Class { } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_name_conflict_with_class.carbon:[[@LINE-5]]:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: interface Class { } // CHECK:STDOUT: --- fail_redefine_without_dependents.carbon diff --git a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon index 3788048d439c..38c16725e766 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon @@ -29,12 +29,13 @@ interface Generic(T:! type); interface Generic {} interface DifferentParams(T:! type); -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+6]]:27: error: type `()` of parameter 1 in redeclaration differs from previous parameter type `type` [RedeclParamDiffersType] +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+7]]:27: error: type `()` of parameter 1 in redeclaration differs from previous parameter type `type` [RedeclParamDiffersType] // CHECK:STDERR: interface DifferentParams(T:! ()) {} // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:27: note: previous declaration's corresponding parameter here [RedeclParamPrevious] // CHECK:STDERR: interface DifferentParams(T:! type); // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: interface DifferentParams(T:! ()) {} // CHECK:STDOUT: --- fail_generic_redeclaration.carbon @@ -91,16 +92,16 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: %T.param: type = value_param runtime_param // CHECK:STDOUT: %T.loc31_27.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc31_27.2 (constants.%T.8b3)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl.loc38: %.type.abf52e.2 = interface_decl @.3 [template = constants.%.generic.0a9e18.2] { -// CHECK:STDOUT: %T.patt.loc38_27.1: %empty_tuple.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc38_27.2 (constants.%T.patt.e60)] -// CHECK:STDOUT: %T.param_patt: %empty_tuple.type = value_param_pattern %T.patt.loc38_27.1, runtime_param [symbolic = %T.patt.loc38_27.2 (constants.%T.patt.e60)] +// CHECK:STDOUT: %.decl.loc39: %.type.abf52e.2 = interface_decl @.3 [template = constants.%.generic.0a9e18.2] { +// CHECK:STDOUT: %T.patt.loc39_27.1: %empty_tuple.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc39_27.2 (constants.%T.patt.e60)] +// CHECK:STDOUT: %T.param_patt: %empty_tuple.type = value_param_pattern %T.patt.loc39_27.1, runtime_param [symbolic = %T.patt.loc39_27.2 (constants.%T.patt.e60)] // CHECK:STDOUT: } { // CHECK:STDOUT: %T.param: %empty_tuple.type = value_param runtime_param -// CHECK:STDOUT: %.loc38_32.1: type = splice_block %.loc38_32.3 [template = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc38_32.2: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc38_32.3: type = converted %.loc38_32.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc39_32.1: type = splice_block %.loc39_32.3 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc39_32.2: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc39_32.3: type = converted %.loc39_32.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc38_27.1: %empty_tuple.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc38_27.2 (constants.%T.7a6)] +// CHECK:STDOUT: %T.loc39_27.1: %empty_tuple.type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc39_27.2 (constants.%T.7a6)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -145,12 +146,12 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.3(%T.loc38_27.1: %empty_tuple.type) { -// CHECK:STDOUT: %T.loc38_27.2: %empty_tuple.type = bind_symbolic_name T, 0 [symbolic = %T.loc38_27.2 (constants.%T.7a6)] -// CHECK:STDOUT: %T.patt.loc38_27.2: %empty_tuple.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc38_27.2 (constants.%T.patt.e60)] +// CHECK:STDOUT: generic interface @.3(%T.loc39_27.1: %empty_tuple.type) { +// CHECK:STDOUT: %T.loc39_27.2: %empty_tuple.type = bind_symbolic_name T, 0 [symbolic = %T.loc39_27.2 (constants.%T.7a6)] +// CHECK:STDOUT: %T.patt.loc39_27.2: %empty_tuple.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc39_27.2 (constants.%T.patt.e60)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.type: type = facet_type <@.3, @.3(%T.loc38_27.2)> [symbolic = %.type (constants.%.type.b4a)] +// CHECK:STDOUT: %.type: type = facet_type <@.3, @.3(%T.loc39_27.2)> [symbolic = %.type (constants.%.type.b4a)] // CHECK:STDOUT: %Self.2: %.type.b4a = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.bb6)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -180,9 +181,9 @@ interface DifferentParams(T:! ()) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.3(constants.%T.7a6) { -// CHECK:STDOUT: %T.loc38_27.2 => constants.%T.7a6 -// CHECK:STDOUT: %T.patt.loc38_27.2 => constants.%T.7a6 +// CHECK:STDOUT: %T.loc39_27.2 => constants.%T.7a6 +// CHECK:STDOUT: %T.patt.loc39_27.2 => constants.%T.7a6 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.3(%T.loc38_27.2) {} +// CHECK:STDOUT: specific @.3(%T.loc39_27.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon b/toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon index 1f6aaadc8159..c77a171db057 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon @@ -22,9 +22,10 @@ let T: type.not_found = {}; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_lookup_type_where.carbon:[[@LINE+3]]:8: error: member name `missing` not found [MemberNameNotFound] +// CHECK:STDERR: fail_lookup_type_where.carbon:[[@LINE+4]]:8: error: member name `missing` not found [MemberNameNotFound] // CHECK:STDERR: let U: (type where .Self impls type).missing = {}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: let U: (type where .Self impls type).missing = {}; // CHECK:STDOUT: --- fail_lookup_in_type.carbon @@ -60,7 +61,7 @@ let U: (type where .Self impls type).missing = {}; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc7: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc8: %empty_struct_type = struct_literal () // CHECK:STDOUT: %U: = bind_name U, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon b/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon index 32576c0de209..82c7c9ef56b2 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon @@ -43,9 +43,10 @@ interface BeingDefined { // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fn H() -> BeingDefined.T; - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+3]]:6: error: name `BeingDefined` not found [NameNotFound] + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+4]]:6: error: name `BeingDefined` not found [NameNotFound] // CHECK:STDERR: fn BeingDefined.I(); // CHECK:STDERR: ^~~~~~~~~~~~ + // CHECK:STDERR: fn BeingDefined.I(); } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon b/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon index b9121df6a3c5..38852fc34569 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon @@ -30,9 +30,10 @@ fn F() { interface Different {} -// CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+3]]:24: error: cannot access member of interface `Interface` in type `Different` that does not implement that interface [MissingImplInMemberAccess] +// CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+4]]:24: error: cannot access member of interface `Interface` in type `Different` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: fn G(U:! Different) -> U.(Interface.T); // CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: fn G(U:! Different) -> U.(Interface.T); // CHECK:STDOUT: --- fail_member_lookup.carbon @@ -67,17 +68,17 @@ fn G(U:! Different) -> U.(Interface.T); // CHECK:STDOUT: %F.decl: %F.type.b25 = fn_decl @F.2 [template = constants.%F.c41] {} {} // CHECK:STDOUT: %Different.decl: type = interface_decl @Different [template = constants.%Different.type] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %U.patt.loc36_6.1: %Different.type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc36_6.2 (constants.%U.patt)] -// CHECK:STDOUT: %U.param_patt: %Different.type = value_param_pattern %U.patt.loc36_6.1, runtime_param [symbolic = %U.patt.loc36_6.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.patt.loc37_6.1: %Different.type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc37_6.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.param_patt: %Different.type = value_param_pattern %U.patt.loc37_6.1, runtime_param [symbolic = %U.patt.loc37_6.2 (constants.%U.patt)] // CHECK:STDOUT: %return.patt: = return_slot_pattern // CHECK:STDOUT: %return.param_patt: = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %U.ref: %Different.type = name_ref U, %U.loc36_6.1 [symbolic = %U.loc36_6.2 (constants.%U)] +// CHECK:STDOUT: %U.ref: %Different.type = name_ref U, %U.loc37_6.1 [symbolic = %U.loc37_6.2 (constants.%U)] // CHECK:STDOUT: %Interface.ref: type = name_ref Interface, file.%Interface.decl [template = constants.%Interface.type] // CHECK:STDOUT: %T.ref: %assoc_type = name_ref T, @Interface.%assoc1 [template = constants.%assoc1] // CHECK:STDOUT: %U.param: %Different.type = value_param runtime_param // CHECK:STDOUT: %Different.ref: type = name_ref Different, file.%Different.decl [template = constants.%Different.type] -// CHECK:STDOUT: %U.loc36_6.1: %Different.type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc36_6.2 (constants.%U)] +// CHECK:STDOUT: %U.loc37_6.1: %Different.type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc37_6.2 (constants.%U)] // CHECK:STDOUT: %return.param: ref = out_param runtime_param0 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } @@ -119,9 +120,9 @@ fn G(U:! Different) -> U.(Interface.T); // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G(%U.loc36_6.1: %Different.type) { -// CHECK:STDOUT: %U.loc36_6.2: %Different.type = bind_symbolic_name U, 0 [symbolic = %U.loc36_6.2 (constants.%U)] -// CHECK:STDOUT: %U.patt.loc36_6.2: %Different.type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc36_6.2 (constants.%U.patt)] +// CHECK:STDOUT: generic fn @G(%U.loc37_6.1: %Different.type) { +// CHECK:STDOUT: %U.loc37_6.2: %Different.type = bind_symbolic_name U, 0 [symbolic = %U.loc37_6.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc37_6.2: %Different.type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc37_6.2 (constants.%U.patt)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%U.param_patt: %Different.type) -> ; // CHECK:STDOUT: } @@ -129,7 +130,7 @@ fn G(U:! Different) -> U.(Interface.T); // CHECK:STDOUT: specific @F.1(constants.%Self.719) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%U) { -// CHECK:STDOUT: %U.loc36_6.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc36_6.2 => constants.%U +// CHECK:STDOUT: %U.loc37_6.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc37_6.2 => constants.%U // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon index f115b08dd809..d7a268d10c84 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon @@ -67,9 +67,10 @@ interface I { library "[[@TEST_NAME]]"; interface I { - // CHECK:STDERR: fail_protected_member.carbon:[[@LINE+3]]:3: error: `protected` not allowed; requires class scope [ModifierProtectedNotAllowed] + // CHECK:STDERR: fail_protected_member.carbon:[[@LINE+4]]:3: error: `protected` not allowed; requires class scope [ModifierProtectedNotAllowed] // CHECK:STDERR: protected fn F[self: Self](); // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: protected fn F[self: Self](); } @@ -222,16 +223,16 @@ interface I { // CHECK:STDOUT: interface @I { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %self.patt: @F.%Self.as_type.loc8_24.1 (%Self.as_type) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @F.%Self.as_type.loc8_24.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %self.patt: @F.%Self.as_type.loc9_24.1 (%Self.as_type) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @F.%Self.as_type.loc9_24.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: @F.%Self.as_type.loc8_24.1 (%Self.as_type) = value_param runtime_param0 -// CHECK:STDOUT: %.loc8_24.1: type = splice_block %.loc8_24.2 [symbolic = %Self.as_type.loc8_24.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %self.param: @F.%Self.as_type.loc9_24.1 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc9_24.1: type = splice_block %.loc9_24.2 [symbolic = %Self.as_type.loc9_24.1 (constants.%Self.as_type)] { // CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc8_24.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc8_24.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc8_24.2: type = converted %Self.ref, %Self.as_type.loc8_24.2 [symbolic = %Self.as_type.loc8_24.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc9_24.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc9_24.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc9_24.2: type = converted %Self.ref, %Self.as_type.loc9_24.2 [symbolic = %Self.as_type.loc9_24.1 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @F.%Self.as_type.loc8_24.1 (%Self.as_type) = bind_name self, %self.param +// CHECK:STDOUT: %self: @F.%Self.as_type.loc9_24.1 (%Self.as_type) = bind_name self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, %F.decl [template = constants.%assoc0] // CHECK:STDOUT: @@ -243,13 +244,13 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(@I.%Self: %I.type) { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc8_24.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_24.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc9_24.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc9_24.1 (constants.%Self.as_type)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @F.%Self.as_type.loc8_24.1 (%Self.as_type)](); +// CHECK:STDOUT: fn[%self.param_patt: @F.%Self.as_type.loc9_24.1 (%Self.as_type)](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc8_24.1 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc9_24.1 => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon b/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon index 6fd07ce7429d..b9f5ce547f9e 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon @@ -10,12 +10,13 @@ interface Interface { fn F(); - // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE+6]]:3: error: duplicate name being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE+7]]:3: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE-4]]:3: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: fn F(); } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon index 07b7eb9cfd58..a9fa2c2cc16f 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon @@ -19,9 +19,10 @@ fn CallStatic(T:! Interface) { } fn CallFacet(T:! Interface, x: T) { - // CHECK:STDERR: fail_todo_facet_lookup.carbon:[[@LINE+3]]:3: error: type `T` does not support qualified expressions [QualifiedExprUnsupported] + // CHECK:STDERR: fail_todo_facet_lookup.carbon:[[@LINE+4]]:3: error: type `T` does not support qualified expressions [QualifiedExprUnsupported] // CHECK:STDERR: x.F(); // CHECK:STDERR: ^~~ + // CHECK:STDERR: x.F(); } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon index 7f4a54793800..96b421ab602f 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon @@ -13,12 +13,13 @@ interface I(T:! type) { fn F[self: Self]() -> Self; } -// CHECK:STDERR: fail_todo_generic_default_fn.carbon:[[@LINE+6]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] +// CHECK:STDERR: fail_todo_generic_default_fn.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_generic_default_fn.carbon:[[@LINE-6]]:3: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: fn F[self: Self]() -> Self; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: --- fail_todo_generic_default_fn.carbon @@ -52,27 +53,27 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: %T.loc11_13.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_13.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [symbolic = constants.%.075] { -// CHECK:STDOUT: %self.patt: @.1.%Self.as_type.loc22_24.2 (%Self.as_type) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @.1.%Self.as_type.loc22_24.2 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: @.1.%Self.as_type.loc22_24.2 (%Self.as_type) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @.1.%Self.as_type.loc22_24.2 (%Self.as_type) = out_param_pattern %return.patt, runtime_param1 +// CHECK:STDOUT: %self.patt: @.1.%Self.as_type.loc23_24.2 (%Self.as_type) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @.1.%Self.as_type.loc23_24.2 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0 +// CHECK:STDOUT: %return.patt: @.1.%Self.as_type.loc23_24.2 (%Self.as_type) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @.1.%Self.as_type.loc23_24.2 (%Self.as_type) = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { // CHECK:STDOUT: %T.param: type = value_param runtime_param -// CHECK:STDOUT: %T.loc22_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc22_6.2 (constants.%T)] -// CHECK:STDOUT: %.loc22_35.1: @.1.%I.type (%I.type.325) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref.loc22_35: @.1.%I.type (%I.type.325) = name_ref Self, %.loc22_35.1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc22_35: type = facet_access_type %Self.ref.loc22_35 [symbolic = %Self.as_type.loc22_24.2 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc22_35.2: type = converted %Self.ref.loc22_35, %Self.as_type.loc22_35 [symbolic = %Self.as_type.loc22_24.2 (constants.%Self.as_type)] -// CHECK:STDOUT: %self.param: @.1.%Self.as_type.loc22_24.2 (%Self.as_type) = value_param runtime_param0 -// CHECK:STDOUT: %.loc22_24.1: type = splice_block %.loc22_24.3 [symbolic = %Self.as_type.loc22_24.2 (constants.%Self.as_type)] { -// CHECK:STDOUT: %.loc22_24.2: @.1.%I.type (%I.type.325) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref.loc22_24: @.1.%I.type (%I.type.325) = name_ref Self, %.loc22_24.2 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc22_24.1: type = facet_access_type %Self.ref.loc22_24 [symbolic = %Self.as_type.loc22_24.2 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc22_24.3: type = converted %Self.ref.loc22_24, %Self.as_type.loc22_24.1 [symbolic = %Self.as_type.loc22_24.2 (constants.%Self.as_type)] +// CHECK:STDOUT: %T.loc23_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc23_6.2 (constants.%T)] +// CHECK:STDOUT: %.loc23_35.1: @.1.%I.type (%I.type.325) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref.loc23_35: @.1.%I.type (%I.type.325) = name_ref Self, %.loc23_35.1 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc23_35: type = facet_access_type %Self.ref.loc23_35 [symbolic = %Self.as_type.loc23_24.2 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc23_35.2: type = converted %Self.ref.loc23_35, %Self.as_type.loc23_35 [symbolic = %Self.as_type.loc23_24.2 (constants.%Self.as_type)] +// CHECK:STDOUT: %self.param: @.1.%Self.as_type.loc23_24.2 (%Self.as_type) = value_param runtime_param0 +// CHECK:STDOUT: %.loc23_24.1: type = splice_block %.loc23_24.3 [symbolic = %Self.as_type.loc23_24.2 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc23_24.2: @.1.%I.type (%I.type.325) = specific_constant @I.%Self.1, @I(constants.%T) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref.loc23_24: @.1.%I.type (%I.type.325) = name_ref Self, %.loc23_24.2 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc23_24.1: type = facet_access_type %Self.ref.loc23_24 [symbolic = %Self.as_type.loc23_24.2 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc23_24.3: type = converted %Self.ref.loc23_24, %Self.as_type.loc23_24.1 [symbolic = %Self.as_type.loc23_24.2 (constants.%Self.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @.1.%Self.as_type.loc22_24.2 (%Self.as_type) = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref @.1.%Self.as_type.loc22_24.2 (%Self.as_type) = out_param runtime_param1 -// CHECK:STDOUT: %return: ref @.1.%Self.as_type.loc22_24.2 (%Self.as_type) = return_slot %return.param +// CHECK:STDOUT: %self: @.1.%Self.as_type.loc23_24.2 (%Self.as_type) = bind_name self, %self.param +// CHECK:STDOUT: %return.param: ref @.1.%Self.as_type.loc23_24.2 (%Self.as_type) = out_param runtime_param1 +// CHECK:STDOUT: %return: ref @.1.%Self.as_type.loc23_24.2 (%Self.as_type) = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -129,19 +130,19 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: fn[%self.param_patt: @F.%Self.as_type.loc13_14.1 (%Self.as_type)]() -> @F.%Self.as_type.loc13_14.1 (%Self.as_type); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @.1(%T.loc22_6.1: type, @I.%Self.1: @I.%I.type (%I.type.325)) { -// CHECK:STDOUT: %T.loc22_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc22_6.2 (constants.%T)] +// CHECK:STDOUT: generic fn @.1(%T.loc23_6.1: type, @I.%Self.1: @I.%I.type (%I.type.325)) { +// CHECK:STDOUT: %T.loc23_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc23_6.2 (constants.%T)] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] -// CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T.loc22_6.2)> [symbolic = %I.type (constants.%I.type.325)] +// CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T.loc23_6.2)> [symbolic = %I.type (constants.%I.type.325)] // CHECK:STDOUT: %Self: %I.type.325 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc22_24.2: type = facet_access_type %Self [symbolic = %Self.as_type.loc22_24.2 (constants.%Self.as_type)] +// CHECK:STDOUT: %Self.as_type.loc23_24.2: type = facet_access_type %Self [symbolic = %Self.as_type.loc23_24.2 (constants.%Self.as_type)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @.1.%Self.as_type.loc22_24.2 (%Self.as_type) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type @.1.%Self.as_type.loc23_24.2 (%Self.as_type) [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @.1.%Self.as_type.loc22_24.2 (%Self.as_type)]() -> @.1.%Self.as_type.loc22_24.2 (%Self.as_type) { +// CHECK:STDOUT: fn[%self.param_patt: @.1.%Self.as_type.loc23_24.2 (%Self.as_type)]() -> @.1.%Self.as_type.loc23_24.2 (%Self.as_type) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: @.1.%Self.as_type.loc22_24.2 (%Self.as_type) = name_ref self, %self +// CHECK:STDOUT: %self.ref: @.1.%Self.as_type.loc23_24.2 (%Self.as_type) = name_ref self, %self // CHECK:STDOUT: return %self.ref // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -171,12 +172,12 @@ fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDOUT: specific @I(%T.loc11_13.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T, constants.%Self) { -// CHECK:STDOUT: %T.loc22_6.2 => constants.%T +// CHECK:STDOUT: %T.loc23_6.2 => constants.%T // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: %I.type => constants.%I.type.325 // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc22_24.2 => constants.%Self.as_type +// CHECK:STDOUT: %Self.as_type.loc23_24.2 => constants.%Self.as_type // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @I(@.1.%T.loc22_6.2) {} +// CHECK:STDOUT: specific @I(@.1.%T.loc23_6.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon index 83cbde225c2b..6b02baad6af3 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon @@ -14,9 +14,10 @@ interface Modifiers { // CHECK:STDERR: ^~~~~ // CHECK:STDERR: final fn Final() { } - // CHECK:STDERR: fail_todo_modifiers.carbon:[[@LINE+3]]:3: error: semantics TODO: `interface modifier` [SemanticsTodo] + // CHECK:STDERR: fail_todo_modifiers.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` [SemanticsTodo] // CHECK:STDERR: default fn Default() { } // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: default fn Default() { } } diff --git a/toolchain/check/testdata/interface/no_prelude/generic.carbon b/toolchain/check/testdata/interface/no_prelude/generic.carbon index c0402d092049..bc3e2953c23f 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic.carbon @@ -49,12 +49,13 @@ class B {} fn F(T:! Generic(A)); fn G(T:! Generic(B)) { // TODO: Include generic arguments in the type name. - // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE+6]]:3: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound] + // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE+7]]:3: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound] // CHECK:STDERR: F(T); // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn F(T:! Generic(A)); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: F(T); } @@ -485,7 +486,7 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %T.ref: %Generic.type.4ce = name_ref T, %T.loc10_6.1 [symbolic = %T.loc10_6.2 (constants.%T.bae)] -// CHECK:STDOUT: %.loc18: %Generic.type.c7c = converted %T.ref, [template = ] +// CHECK:STDOUT: %.loc19: %Generic.type.c7c = converted %T.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon index e7692b9352f0..959b55342d9c 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon @@ -42,9 +42,10 @@ interface A[T: type]() {} library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:13: error: parameters of generic types must be constant [GenericParamMustBeConstant] +// CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+4]]:13: error: parameters of generic types must be constant [GenericParamMustBeConstant] // CHECK:STDERR: interface A(T: type) {} // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: interface A(T: type) {} // CHECK:STDOUT: --- params.carbon diff --git a/toolchain/check/testdata/interface/no_prelude/import_access.carbon b/toolchain/check/testdata/interface/no_prelude/import_access.carbon index 01a81fd541a2..60ab34895d90 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_access.carbon @@ -132,9 +132,10 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward"; -// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:9: error: name `Forward` not found [NameNotFound] +// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+4]]:9: error: name `Forward` not found [NameNotFound] // CHECK:STDERR: fn F(i: Forward*) {} // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: fn F(i: Forward*) {} // --- todo_fail_private_on_redecl.carbon @@ -502,7 +503,7 @@ private interface Redecl {} // CHECK:STDOUT: %i.param_patt: = value_param_pattern %i.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %i.param: = value_param runtime_param0 -// CHECK:STDOUT: %.loc9: type = splice_block %ptr [template = ] { +// CHECK:STDOUT: %.loc10: type = splice_block %ptr [template = ] { // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] // CHECK:STDOUT: %ptr: type = ptr_type [template = ] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon b/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon index 410936a885e4..06d1b242b3f9 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon @@ -18,9 +18,10 @@ impl library "[[@TEST_NAME]]"; // --- fail_b.carbon library "[[@TEST_NAME]]"; interface B {} -// CHECK:STDERR: fail_b.carbon:[[@LINE+3]]:1: error: impl declared but not defined [ImplMissingDefinition] +// CHECK:STDERR: fail_b.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition] // CHECK:STDERR: impl () as B; // CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: impl () as B; // --- b.impl.carbon @@ -70,8 +71,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDOUT: } // CHECK:STDOUT: %B.decl: type = interface_decl @B [template = constants.%B.type] {} {} // CHECK:STDOUT: impl_decl @impl [template] {} { -// CHECK:STDOUT: %.loc6_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc7_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc7_7.2: type = converted %.loc7_7.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B.type] // CHECK:STDOUT: } // CHECK:STDOUT: %impl_witness: = impl_witness () [template = constants.%impl_witness] @@ -85,7 +86,7 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc6_7.2 as %B.ref; +// CHECK:STDOUT: impl @impl: %.loc7_7.2 as %B.ref; // CHECK:STDOUT: // CHECK:STDOUT: --- b.impl.carbon // CHECK:STDOUT: @@ -97,8 +98,8 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.8b9 = import_ref Main//b, B, unloaded // CHECK:STDOUT: %import_ref.420 = import_ref Main//b, inst15 [no loc], unloaded -// CHECK:STDOUT: %import_ref.e5c: type = import_ref Main//b, loc6_7, loaded [template = constants.%empty_tuple.type] -// CHECK:STDOUT: %import_ref.171: type = import_ref Main//b, loc6_12, loaded [template = constants.%B.type] +// CHECK:STDOUT: %import_ref.e5c: type = import_ref Main//b, loc7_7, loaded [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %import_ref.171: type = import_ref Main//b, loc7_12, loaded [template = constants.%B.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon index fde8e4c57a3d..1c609cb75ffa 100644 --- a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon @@ -173,16 +173,17 @@ library "[[@TEST_NAME]]"; class C {} interface Foo(a:! const C); -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+10]]:19: warning: `const` applied repeatedly to the same type has no additional effect [RepeatedConst] +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+11]]:19: warning: `const` applied repeatedly to the same type has no additional effect [RepeatedConst] // CHECK:STDERR: interface Foo(a:! const (const C)) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+6]]:25: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+7]]:25: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers] // CHECK:STDERR: interface Foo(a:! const (const C)) {} // CHECK:STDERR: ^ // CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:25: note: comparing with previous declaration here [RedeclParamSyntaxPrevious] // CHECK:STDERR: interface Foo(a:! const C); // CHECK:STDERR: ^ +// CHECK:STDERR: interface Foo(a:! const (const C)) {} // CHECK:STDOUT: --- basic.carbon @@ -1135,16 +1136,16 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.loc6_15.1: %const = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc6_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: %.decl: %.type.abf = interface_decl @.1 [template = constants.%.generic] { -// CHECK:STDOUT: %a.patt.loc17_15.1: %const = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc17_15.2 (constants.%a.patt)] -// CHECK:STDOUT: %a.param_patt: %const = value_param_pattern %a.patt.loc17_15.1, runtime_param [symbolic = %a.patt.loc17_15.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.patt.loc18_15.1: %const = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc18_15.2 (constants.%a.patt)] +// CHECK:STDOUT: %a.param_patt: %const = value_param_pattern %a.patt.loc18_15.1, runtime_param [symbolic = %a.patt.loc18_15.2 (constants.%a.patt)] // CHECK:STDOUT: } { // CHECK:STDOUT: %a.param: %const = value_param runtime_param -// CHECK:STDOUT: %.loc17: type = splice_block %const.loc17_19 [template = constants.%const] { +// CHECK:STDOUT: %.loc18: type = splice_block %const.loc18_19 [template = constants.%const] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %const.loc17_26: type = const_type %C [template = constants.%const] -// CHECK:STDOUT: %const.loc17_19: type = const_type %const [template = constants.%const] +// CHECK:STDOUT: %const.loc18_26: type = const_type %C [template = constants.%const] +// CHECK:STDOUT: %const.loc18_19: type = const_type %const [template = constants.%const] // CHECK:STDOUT: } -// CHECK:STDOUT: %a.loc17_15.1: %const = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc17_15.2 (constants.%a)] +// CHECK:STDOUT: %a.loc18_15.1: %const = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc18_15.2 (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1155,12 +1156,12 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.1(%a.loc17_15.1: %const) { -// CHECK:STDOUT: %a.loc17_15.2: %const = bind_symbolic_name a, 0 [symbolic = %a.loc17_15.2 (constants.%a)] -// CHECK:STDOUT: %a.patt.loc17_15.2: %const = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc17_15.2 (constants.%a.patt)] +// CHECK:STDOUT: generic interface @.1(%a.loc18_15.1: %const) { +// CHECK:STDOUT: %a.loc18_15.2: %const = bind_symbolic_name a, 0 [symbolic = %a.loc18_15.2 (constants.%a)] +// CHECK:STDOUT: %a.patt.loc18_15.2: %const = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc18_15.2 (constants.%a.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.type: type = facet_type <@.1, @.1(%a.loc17_15.2)> [symbolic = %.type (constants.%.type.963)] +// CHECK:STDOUT: %.type: type = facet_type <@.1, @.1(%a.loc18_15.2)> [symbolic = %.type (constants.%.type.963)] // CHECK:STDOUT: %Self.2: %.type.963 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { @@ -1183,9 +1184,9 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%a) { -// CHECK:STDOUT: %a.loc17_15.2 => constants.%a -// CHECK:STDOUT: %a.patt.loc17_15.2 => constants.%a +// CHECK:STDOUT: %a.loc18_15.2 => constants.%a +// CHECK:STDOUT: %a.patt.loc18_15.2 => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @.1(%a.loc17_15.2) {} +// CHECK:STDOUT: specific @.1(%a.loc18_15.2) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/bad_import.carbon b/toolchain/check/testdata/interop/cpp/no_prelude/bad_import.carbon index 93c587bb80b0..e25c4790012e 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/bad_import.carbon +++ b/toolchain/check/testdata/interop/cpp/no_prelude/bad_import.carbon @@ -22,11 +22,12 @@ import Cpp; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_cpp_library_empty.carbon:[[@LINE+5]]:1: error: `Cpp` import missing library [CppInteropMissingLibrary] +// CHECK:STDERR: fail_import_cpp_library_empty.carbon:[[@LINE+6]]:1: error: `Cpp` import missing library [CppInteropMissingLibrary] // CHECK:STDERR: import Cpp library ""; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: // CHECK:STDERR: "foo.h": error: error opening file for read: No such file or directory [ErrorOpeningFile] +// CHECK:STDERR: import Cpp library ""; // --- fail_import_cpp_library_file_with_quotes.carbon diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/cpp_diagnostics.carbon b/toolchain/check/testdata/interop/cpp/no_prelude/cpp_diagnostics.carbon index 62d411780cc6..b65d2044eb08 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/cpp_diagnostics.carbon +++ b/toolchain/check/testdata/interop/cpp/no_prelude/cpp_diagnostics.carbon @@ -126,7 +126,7 @@ import Cpp library "one_error_and_one_warning.h"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+19]]:1: error: 2 errors and 3 warnings in `Cpp` import `multiple_errors_and_multiple_warnings.h`: +// CHECK:STDERR: fail_import_cpp_file_with_multiple_errors_and_multiple_warnings.carbon:[[@LINE+20]]:1: error: 2 errors and 3 warnings in `Cpp` import `multiple_errors_and_multiple_warnings.h`: // CHECK:STDERR: multiple_errors_and_multiple_warnings.h:2:2: error: "error1" // CHECK:STDERR: 2 | #error "error1" // CHECK:STDERR: | ^ @@ -145,6 +145,7 @@ library "[[@TEST_NAME]]"; // CHECK:STDERR: [CppInteropParseError] // CHECK:STDERR: import Cpp library "multiple_errors_and_multiple_warnings.h"; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: import Cpp library "multiple_errors_and_multiple_warnings.h"; // CHECK:STDOUT: --- fail_import_cpp_file_with_one_error.carbon diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/file_not_found.carbon b/toolchain/check/testdata/interop/cpp/no_prelude/file_not_found.carbon index 876270079770..794cebf21977 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/file_not_found.carbon +++ b/toolchain/check/testdata/interop/cpp/no_prelude/file_not_found.carbon @@ -8,6 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/file_not_found.carbon // CHECK:STDERR: not_found.h: error: error opening file for read: No such file or directory [ErrorOpeningFile] +// CHECK:STDERR: // --- fail_cpp_file_not_found.carbon diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/multiple_imports.carbon b/toolchain/check/testdata/interop/cpp/no_prelude/multiple_imports.carbon index 7e96e21e85fb..e77c6e3d595e 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/multiple_imports.carbon +++ b/toolchain/check/testdata/interop/cpp/no_prelude/multiple_imports.carbon @@ -21,9 +21,10 @@ void foo1(); library "[[@TEST_NAME]]"; import Cpp library "file1.h"; -// CHECK:STDERR: fail_multiple_imports.carbon:[[@LINE+3]]:1: error: semantics TODO: `multiple Cpp imports are not yet supported` [SemanticsTodo] +// CHECK:STDERR: fail_multiple_imports.carbon:[[@LINE+4]]:1: error: semantics TODO: `multiple Cpp imports are not yet supported` [SemanticsTodo] // CHECK:STDERR: import Cpp library "file2.h"; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: import Cpp library "file2.h"; // CHECK:STDOUT: --- fail_multiple_imports.carbon diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index 581aa5a5c9fa..67a6a45af98d 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -156,9 +156,10 @@ library "[[@TEST_NAME]]"; interface Empty {} impl i32 as Empty { - // CHECK:STDERR: fail_use_in_impl.carbon:[[@LINE+3]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo] + // CHECK:STDERR: fail_use_in_impl.carbon:[[@LINE+4]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo] // CHECK:STDERR: let Zero:! i32 = 0; // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: let Zero:! i32 = 0; } @@ -817,9 +818,9 @@ impl i32 as Empty { // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc10_21.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc10_21.2: %i32 = converted %int_0, %.loc10_21.1 [template = constants.%int_0.6a9] -// CHECK:STDOUT: %Zero: %i32 = bind_name Zero, %.loc10_21.2 +// CHECK:STDOUT: %.loc11_21.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc11_21.2: %i32 = converted %int_0, %.loc11_21.1 [template = constants.%int_0.6a9] +// CHECK:STDOUT: %Zero: %i32 = bind_name Zero, %.loc11_21.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Zero = %Zero diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index 2152f9a6e449..f0d4b03ea8c1 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -10,12 +10,13 @@ fn F() { let a: i32 = 1; - // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: error: duplicate name being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+7]]:7: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: let a: i32 = 2; // CHECK:STDERR: ^ // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: let a: i32 = 1; // CHECK:STDERR: ^ + // CHECK:STDERR: let a: i32 = 2; } @@ -69,13 +70,13 @@ fn F() { // CHECK:STDOUT: %.loc12_17.2: %i32 = converted %int_1, %.loc12_17.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %a.loc12: %i32 = bind_name a, %.loc12_17.2 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc19: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc19: = bound_method %int_2, %impl.elem0.loc19 [template = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %Convert.specific_fn.loc19: = specific_function %Convert.bound.loc19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] -// CHECK:STDOUT: %int.convert_checked.loc19: init %i32 = call %Convert.specific_fn.loc19(%int_2) [template = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc19_17.1: %i32 = value_of_initializer %int.convert_checked.loc19 [template = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc19_17.2: %i32 = converted %int_2, %.loc19_17.1 [template = constants.%int_2.ef8] -// CHECK:STDOUT: %a.loc19: %i32 = bind_name a, %.loc19_17.2 +// CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc20: = bound_method %int_2, %impl.elem0.loc20 [template = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %Convert.specific_fn.loc20: = specific_function %Convert.bound.loc20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787] +// CHECK:STDOUT: %int.convert_checked.loc20: init %i32 = call %Convert.specific_fn.loc20(%int_2) [template = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc20_17.1: %i32 = value_of_initializer %int.convert_checked.loc20 [template = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc20_17.2: %i32 = converted %int_2, %.loc20_17.1 [template = constants.%int_2.ef8] +// CHECK:STDOUT: %a.loc20: %i32 = bind_name a, %.loc20_17.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index fae1d380b615..d0bb8f253594 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -19,12 +19,13 @@ fn F(a: i32) -> i32 { // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: let x: T = 5; - // CHECK:STDERR: fail_generic.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `T` to `i32` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_generic.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `T` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: return x; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:3: note: type `T` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_generic.carbon:[[@LINE+4]]:3: note: type `T` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: return x; // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: return x; } @@ -82,7 +83,7 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %.loc21: %T = converted %int_5, [template = ] // CHECK:STDOUT: %x: %T = bind_name x, // CHECK:STDOUT: %x.ref: %T = name_ref x, %x -// CHECK:STDOUT: %.loc28: %i32 = converted %x.ref, [template = ] +// CHECK:STDOUT: %.loc29: %i32 = converted %x.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_generic_import.carbon b/toolchain/check/testdata/let/fail_generic_import.carbon index c3ce359334aa..f0fd9233f845 100644 --- a/toolchain/check/testdata/let/fail_generic_import.carbon +++ b/toolchain/check/testdata/let/fail_generic_import.carbon @@ -23,9 +23,10 @@ let T:! type = i32; impl package Implicit; // TODO: Should this be valid? -// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:8: error: cannot evaluate type expression [TypeExprEvaluationFailure] +// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+4]]:8: error: cannot evaluate type expression [TypeExprEvaluationFailure] // CHECK:STDERR: let a: T = 0; // CHECK:STDERR: ^ +// CHECK:STDERR: let a: T = 0; // CHECK:STDOUT: --- fail_implicit.carbon diff --git a/toolchain/check/testdata/let/fail_missing_value.carbon b/toolchain/check/testdata/let/fail_missing_value.carbon index 54376f6ddd7d..da14d72cb75a 100644 --- a/toolchain/check/testdata/let/fail_missing_value.carbon +++ b/toolchain/check/testdata/let/fail_missing_value.carbon @@ -15,9 +15,10 @@ let n: i32; fn F() { - // CHECK:STDERR: fail_missing_value.carbon:[[@LINE+3]]:13: error: expected `=`; `let` declaration must have an initializer [ExpectedInitializerAfterLet] + // CHECK:STDERR: fail_missing_value.carbon:[[@LINE+4]]:13: error: expected `=`; `let` declaration must have an initializer [ExpectedInitializerAfterLet] // CHECK:STDERR: let n: i32; // CHECK:STDERR: ^ + // CHECK:STDERR: let n: i32; } diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index 9628dca16c74..883617c1010c 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -71,16 +71,17 @@ default default let g: i32 = 1; // CHECK:STDERR: protected private let h: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+10]]:11: error: `protected` repeated on declaration [ModifierRepeated] +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:11: error: `protected` repeated on declaration [ModifierRepeated] // CHECK:STDERR: protected protected let i: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:1: note: `protected` previously appeared here [ModifierPrevious] +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+8]]:1: note: `protected` previously appeared here [ModifierPrevious] // CHECK:STDERR: protected protected let i: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `protected` not allowed; requires class scope [ModifierProtectedNotAllowed] +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `protected` not allowed; requires class scope [ModifierProtectedNotAllowed] // CHECK:STDERR: protected protected let i: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: protected protected let i: i32 = 1; // CHECK:STDOUT: --- fail_modifiers.carbon @@ -180,14 +181,14 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.loc72_33.1: %i32 = value_of_initializer %int.convert_checked.loc72 [template = constants.%int_1.5d2] // CHECK:STDOUT: %.loc72_33.2: %i32 = converted %int_1.loc72, %.loc72_33.1 [template = constants.%int_1.5d2] // CHECK:STDOUT: %h: %i32 = bind_name h, %.loc72_33.2 -// CHECK:STDOUT: %int_1.loc84: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc84: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc84: = bound_method %int_1.loc84, %impl.elem0.loc84 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn.loc84: = specific_function %Convert.bound.loc84, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc84: init %i32 = call %Convert.specific_fn.loc84(%int_1.loc84) [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc84_35.1: %i32 = value_of_initializer %int.convert_checked.loc84 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc84_35.2: %i32 = converted %int_1.loc84, %.loc84_35.1 [template = constants.%int_1.5d2] -// CHECK:STDOUT: %i: %i32 = bind_name i, %.loc84_35.2 +// CHECK:STDOUT: %int_1.loc85: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] +// CHECK:STDOUT: %impl.elem0.loc85: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc85: = bound_method %int_1.loc85, %impl.elem0.loc85 [template = constants.%Convert.bound] +// CHECK:STDOUT: %Convert.specific_fn.loc85: = specific_function %Convert.bound.loc85, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] +// CHECK:STDOUT: %int.convert_checked.loc85: init %i32 = call %Convert.specific_fn.loc85(%int_1.loc85) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc85_35.1: %i32 = value_of_initializer %int.convert_checked.loc85 [template = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc85_35.2: %i32 = converted %int_1.loc85, %.loc85_35.1 [template = constants.%int_1.5d2] +// CHECK:STDOUT: %i: %i32 = bind_name i, %.loc85_35.2 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_use_in_init.carbon b/toolchain/check/testdata/let/fail_use_in_init.carbon index 51f4d97f4567..d14a037988da 100644 --- a/toolchain/check/testdata/let/fail_use_in_init.carbon +++ b/toolchain/check/testdata/let/fail_use_in_init.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/fail_use_in_init.carbon fn F() { - // CHECK:STDERR: fail_use_in_init.carbon:[[@LINE+3]]:16: error: name `a` not found [NameNotFound] + // CHECK:STDERR: fail_use_in_init.carbon:[[@LINE+4]]:16: error: name `a` not found [NameNotFound] // CHECK:STDERR: let a: i32 = a; // CHECK:STDERR: ^ + // CHECK:STDERR: let a: i32 = a; } diff --git a/toolchain/check/testdata/let/generic_import.carbon b/toolchain/check/testdata/let/generic_import.carbon index b3814e73a7e2..dd09f2737821 100644 --- a/toolchain/check/testdata/let/generic_import.carbon +++ b/toolchain/check/testdata/let/generic_import.carbon @@ -27,9 +27,10 @@ impl package Implicit; // CHECK:STDERR: ^~ // CHECK:STDERR: var a: T*; -// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:8: error: cannot evaluate type expression [TypeExprEvaluationFailure] +// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+4]]:8: error: cannot evaluate type expression [TypeExprEvaluationFailure] // CHECK:STDERR: var b: T = *a; // CHECK:STDERR: ^ +// CHECK:STDERR: var b: T = *a; // CHECK:STDOUT: --- fail_implicit.carbon @@ -92,7 +93,7 @@ var b: T = *a; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: ref = name_ref a, file.%a -// CHECK:STDOUT: %.loc12: ref = deref +// CHECK:STDOUT: %.loc13: ref = deref // CHECK:STDOUT: assign file.%b.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/no_prelude/import_access.carbon b/toolchain/check/testdata/let/no_prelude/import_access.carbon index 914dc07fffd2..63e6a21ae4b9 100644 --- a/toolchain/check/testdata/let/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/let/no_prelude/import_access.carbon @@ -46,9 +46,10 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:14: error: member name `v` not found in `Test` [MemberNameNotFoundInScope] +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:14: error: member name `v` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: let v2: () = Test.v; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: let v2: () = Test.v; // CHECK:STDOUT: --- def.carbon diff --git a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon index cfcc03cc77b6..fdc50b8f273b 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon @@ -38,13 +38,14 @@ fn NS(); // we don't move it. namespace NS; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_conflict.carbon:[[@LINE-23]]:1: in import [InImport] // CHECK:STDERR: namespace.carbon:4:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: fn NS(); // CHECK:STDOUT: --- namespace.carbon @@ -93,7 +94,7 @@ fn NS(); // CHECK:STDOUT: %NS.loc8: = namespace [template] {} // CHECK:STDOUT: %.decl.loc18: %.type.b6a92a.1 = fn_decl @.1 [template = constants.%.d852be.1] {} {} // CHECK:STDOUT: %NS.loc22: = namespace [template] {} -// CHECK:STDOUT: %.decl.loc31: %.type.b6a92a.2 = fn_decl @.2 [template = constants.%.d852be.2] {} {} +// CHECK:STDOUT: %.decl.loc32: %.type.b6a92a.2 = fn_decl @.2 [template = constants.%.d852be.2] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @.1(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon index 9e7a5ac9ae1c..34273c6cc0ee 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon @@ -20,13 +20,14 @@ package Example; import library "namespace"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_conflict.carbon:[[@LINE-5]]:1: in import [InImport] // CHECK:STDERR: namespace.carbon:4:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: fn NS(); fn NS.Foo(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon index e3dca5294bd7..7a991a124b17 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon @@ -24,13 +24,14 @@ import Other; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: namespace Other; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:10: error: imported packages cannot be used for declarations [QualifiedDeclOutsidePackage] +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:10: error: imported packages cannot be used for declarations [QualifiedDeclOutsidePackage] // CHECK:STDERR: fn Other.Nested.F(); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_conflict.carbon:[[@LINE-12]]:1: in import [InImport] // CHECK:STDERR: fn.carbon:3:1: note: package imported here [QualifiedDeclOutsidePackageSource] // CHECK:STDERR: namespace Nested; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Other.Nested.F(); // CHECK:STDOUT: --- fn.carbon diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon index 835b13a61a6a..557b53a3b2e8 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon @@ -30,13 +30,14 @@ import library "fn"; // CHECK:STDERR: namespace NS; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:4: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope] +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:4: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope] // CHECK:STDERR: fn NS.Foo(); // CHECK:STDERR: ^~ // CHECK:STDERR: fail_conflict.carbon:[[@LINE-15]]:1: in import [InImport] // CHECK:STDERR: fn.carbon:4:1: note: referenced non-scope entity declared here [QualifiedNameNonScopeEntity] // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: fn NS.Foo(); // CHECK:STDOUT: --- fn.carbon diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon index 6d8d86ba57a5..efe90a96d9d2 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon @@ -25,14 +25,15 @@ fn NS() {} package Example library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: in import [InImport] +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:1: in import [InImport] // CHECK:STDERR: fn.carbon:4:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: fn NS() {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1: in import [InImport] +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+5]]:1: in import [InImport] // CHECK:STDERR: namespace.carbon:4:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: import library "namespace"; import library "fn"; diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon index a16fa3f5c8ce..d8b44b7b1a85 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon @@ -25,14 +25,15 @@ fn NS.Foo() {} package Example library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: in import [InImport] +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:1: in import [InImport] // CHECK:STDERR: namespace.carbon:4:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1: in import [InImport] +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+5]]:1: in import [InImport] // CHECK:STDERR: fn.carbon:4:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: fn NS() {} // CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: import library "fn"; import library "namespace"; diff --git a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon index 027625debf6c..8753b7466cc1 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -13,12 +13,13 @@ namespace NS; alias ns = NS; // Aliases can't be used when declaring names. -// CHECK:STDERR: fail_decl_in_alias.carbon:[[@LINE+6]]:4: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope] +// CHECK:STDERR: fail_decl_in_alias.carbon:[[@LINE+7]]:4: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope] // CHECK:STDERR: fn ns.A() -> i32 { return 0; } // CHECK:STDERR: ^~ // CHECK:STDERR: fail_decl_in_alias.carbon:[[@LINE-6]]:7: note: referenced non-scope entity declared here [QualifiedNameNonScopeEntity] // CHECK:STDERR: alias ns = NS; // CHECK:STDERR: ^~ +// CHECK:STDERR: fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: --- fail_decl_in_alias.carbon @@ -75,8 +76,8 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc22_28.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc22_28.2: %i32 = converted %int_0, %.loc22_28.1 [template = constants.%int_0.6a9] -// CHECK:STDOUT: return %.loc22_28.2 +// CHECK:STDOUT: %.loc23_28.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc23_28.2: %i32 = converted %int_0, %.loc23_28.1 [template = constants.%int_0.6a9] +// CHECK:STDOUT: return %.loc23_28.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/fail_duplicate.carbon b/toolchain/check/testdata/namespace/fail_duplicate.carbon index bc5c12c38ff5..05cbba196ceb 100644 --- a/toolchain/check/testdata/namespace/fail_duplicate.carbon +++ b/toolchain/check/testdata/namespace/fail_duplicate.carbon @@ -13,12 +13,13 @@ namespace Foo; fn Foo.Baz() { } -// CHECK:STDERR: fail_duplicate.carbon:[[@LINE+6]]:1: error: redefinition of `fn Baz` [RedeclRedef] +// CHECK:STDERR: fail_duplicate.carbon:[[@LINE+7]]:1: error: redefinition of `fn Baz` [RedeclRedef] // CHECK:STDERR: fn Foo.Baz() { // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_duplicate.carbon:[[@LINE-6]]:1: note: previously defined here [RedeclPrevDef] // CHECK:STDERR: fn Foo.Baz() { // CHECK:STDERR: ^~~~~~~~~~~~~~ +// CHECK:STDERR: fn Foo.Baz() { } diff --git a/toolchain/check/testdata/namespace/fail_modifiers.carbon b/toolchain/check/testdata/namespace/fail_modifiers.carbon index 6002488c900c..57738cae09bd 100644 --- a/toolchain/check/testdata/namespace/fail_modifiers.carbon +++ b/toolchain/check/testdata/namespace/fail_modifiers.carbon @@ -49,9 +49,10 @@ private extern abstract base default final namespace A; // CHECK:STDERR: impl namespace B; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `extern` not allowed on `namespace` declaration [ModifierNotAllowedOnDeclaration] +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `extern` not allowed on `namespace` declaration [ModifierNotAllowedOnDeclaration] // CHECK:STDERR: extern namespace C; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: extern namespace C; // CHECK:STDOUT: --- fail_modifiers.carbon diff --git a/toolchain/check/testdata/namespace/fail_not_top_level.carbon b/toolchain/check/testdata/namespace/fail_not_top_level.carbon index 8137f5aec6de..98ec03b5da0e 100644 --- a/toolchain/check/testdata/namespace/fail_not_top_level.carbon +++ b/toolchain/check/testdata/namespace/fail_not_top_level.carbon @@ -27,9 +27,10 @@ class C { } interface I { - // CHECK:STDERR: fail_not_top_level.carbon:[[@LINE+3]]:3: error: `namespace` declaration not at top level [NamespaceDeclNotAtTopLevel] + // CHECK:STDERR: fail_not_top_level.carbon:[[@LINE+4]]:3: error: `namespace` declaration not at top level [NamespaceDeclNotAtTopLevel] // CHECK:STDERR: namespace N; // CHECK:STDERR: ^~~~~~~~~~~~ + // CHECK:STDERR: namespace N; fn N.I() {} } diff --git a/toolchain/check/testdata/namespace/fail_params.carbon b/toolchain/check/testdata/namespace/fail_params.carbon index 864beddc2421..5bc1b7dc4c2e 100644 --- a/toolchain/check/testdata/namespace/fail_params.carbon +++ b/toolchain/check/testdata/namespace/fail_params.carbon @@ -30,12 +30,13 @@ namespace B(n: i32); namespace C[T:! type](x: T); namespace D; -// CHECK:STDERR: fail_params.carbon:[[@LINE+6]]:4: error: redeclaration differs because of parameter list [RedeclParamListDiffers] +// CHECK:STDERR: fail_params.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter list [RedeclParamListDiffers] // CHECK:STDERR: fn D(T:! type).F() {} // CHECK:STDERR: ^ // CHECK:STDERR: fail_params.carbon:[[@LINE-4]]:1: note: previously declared without parameter list [RedeclParamListPrevious] // CHECK:STDERR: namespace D; // CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: fn D(T:! type).F() {} // CHECK:STDOUT: --- fail_params.carbon @@ -88,7 +89,7 @@ fn D(T:! type).F() {} // CHECK:STDOUT: %D: = namespace [template] {} // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.d85] {} { // CHECK:STDOUT: %T.param: type = value_param runtime_param -// CHECK:STDOUT: %T.loc39_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc39_6.2 (constants.%T)] +// CHECK:STDOUT: %T.loc40_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc40_6.2 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -97,8 +98,8 @@ fn D(T:! type).F() {} // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @.1(%T.loc39_6.1: type) { -// CHECK:STDOUT: %T.loc39_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc39_6.2 (constants.%T)] +// CHECK:STDOUT: generic fn @.1(%T.loc40_6.1: type) { +// CHECK:STDOUT: %T.loc40_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc40_6.2 (constants.%T)] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -110,7 +111,7 @@ fn D(T:! type).F() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @.1(constants.%T) { -// CHECK:STDOUT: %T.loc39_6.2 => constants.%T +// CHECK:STDOUT: %T.loc40_6.2 => constants.%T // CHECK:STDOUT: %T.patt => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon b/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon index d471f4042a52..99a45b810a52 100644 --- a/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon +++ b/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/namespace/fail_unresolved_scope.carbon -// CHECK:STDERR: fail_unresolved_scope.carbon:[[@LINE+3]]:4: error: name `Foo` not found [NameNotFound] +// CHECK:STDERR: fail_unresolved_scope.carbon:[[@LINE+4]]:4: error: name `Foo` not found [NameNotFound] // CHECK:STDERR: fn Foo.Baz() { // CHECK:STDERR: ^~~ +// CHECK:STDERR: fn Foo.Baz() { } diff --git a/toolchain/check/testdata/namespace/imported_indirect.carbon b/toolchain/check/testdata/namespace/imported_indirect.carbon index cbb9cad0c5c6..631333523661 100644 --- a/toolchain/check/testdata/namespace/imported_indirect.carbon +++ b/toolchain/check/testdata/namespace/imported_indirect.carbon @@ -73,7 +73,7 @@ package Other library "[[@TEST_NAME]]"; import Same library "b"; -// CHECK:STDERR: fail_named_indirectly_different_package.carbon:[[@LINE+12]]:10: error: function returns incomplete type `Same.A.C` [IncompleteTypeInFunctionReturnType] +// CHECK:STDERR: fail_named_indirectly_different_package.carbon:[[@LINE+13]]:10: error: function returns incomplete type `Same.A.C` [IncompleteTypeInFunctionReturnType] // CHECK:STDERR: fn G() { Same.F(); } // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_named_indirectly_different_package.carbon:[[@LINE-5]]:1: in import [InImport] @@ -85,6 +85,7 @@ import Same library "b"; // CHECK:STDERR: b.carbon:7:8: note: return type declared here [IncompleteReturnTypeHere] // CHECK:STDERR: fn F() -> A.C; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fn G() { Same.F(); } // CHECK:STDOUT: --- a.carbon diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon index 0330e1bc949e..dc15e8c0adb2 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon @@ -48,17 +48,18 @@ var and_val: bool = true and true; // CHECK:STDERR: var or_: F(true or true); -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+11]]:20: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+12]]:20: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var or_val: bool = true or true; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+7]]:20: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+8]]:20: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var or_val: bool = true or true; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+3]]:20: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+4]]:20: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var or_val: bool = true or true; // CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: var or_val: bool = true or true; // CHECK:STDOUT: --- fail_and_or_not_in_function.carbon diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon index 9f917c1a3698..044768c4b675 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon @@ -37,9 +37,10 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var c: if x and false then bool else (); - // CHECK:STDERR: fail_despite_known_result.carbon:[[@LINE+3]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] + // CHECK:STDERR: fail_despite_known_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure] // CHECK:STDERR: var d: if x or true then bool else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: var d: if x or true then bool else (); } diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon index d678ec4052b9..3b3010b13052 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon @@ -14,9 +14,10 @@ fn Main() { // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: undeclared = 42; - // CHECK:STDERR: fail_assignment_to_error.carbon:[[@LINE+3]]:4: error: name `also_undeclared` not found [NameNotFound] + // CHECK:STDERR: fail_assignment_to_error.carbon:[[@LINE+4]]:4: error: name `also_undeclared` not found [NameNotFound] // CHECK:STDERR: *also_undeclared = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: *also_undeclared = 42; } @@ -50,9 +51,9 @@ fn Main() { // CHECK:STDOUT: %int_42.loc16: Core.IntLiteral = int_value 42 [template = constants.%int_42] // CHECK:STDOUT: assign %undeclared.ref, // CHECK:STDOUT: %also_undeclared.ref: = name_ref also_undeclared, [template = ] -// CHECK:STDOUT: %.loc20: ref = deref -// CHECK:STDOUT: %int_42.loc20: Core.IntLiteral = int_value 42 [template = constants.%int_42] -// CHECK:STDOUT: assign %.loc20, +// CHECK:STDOUT: %.loc21: ref = deref +// CHECK:STDOUT: %int_42.loc21: Core.IntLiteral = int_value 42 [template = constants.%int_42] +// CHECK:STDOUT: assign %.loc21, // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon index e69caa6032a0..aa0bd2fcad92 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon @@ -50,9 +50,10 @@ fn Main() { // Under #911, if expressions are never reference expressions. var a: i32; - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+3]]:3: error: expression is not assignable [AssignmentToNonAssignable] + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable [AssignmentToNonAssignable] // CHECK:STDERR: (if true then a else a) = 10; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: (if true then a else a) = 10; } @@ -254,28 +255,28 @@ fn Main() { // CHECK:STDOUT: assign %.loc49_4, %.loc49_27 // CHECK:STDOUT: %a.var: ref %i32 = var a // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var -// CHECK:STDOUT: %true.loc56: bool = bool_literal true [template = constants.%true] -// CHECK:STDOUT: if %true.loc56 br !if.expr.then.loc56 else br !if.expr.else.loc56 +// CHECK:STDOUT: %true.loc57: bool = bool_literal true [template = constants.%true] +// CHECK:STDOUT: if %true.loc57 br !if.expr.then.loc57 else br !if.expr.else.loc57 // CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc56: -// CHECK:STDOUT: %a.ref.loc56_17: ref %i32 = name_ref a, %a -// CHECK:STDOUT: %.loc56_17: %i32 = bind_value %a.ref.loc56_17 -// CHECK:STDOUT: br !if.expr.result.loc56(%.loc56_17) +// CHECK:STDOUT: !if.expr.then.loc57: +// CHECK:STDOUT: %a.ref.loc57_17: ref %i32 = name_ref a, %a +// CHECK:STDOUT: %.loc57_17: %i32 = bind_value %a.ref.loc57_17 +// CHECK:STDOUT: br !if.expr.result.loc57(%.loc57_17) // CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc56: -// CHECK:STDOUT: %a.ref.loc56_24: ref %i32 = name_ref a, %a -// CHECK:STDOUT: %.loc56_24: %i32 = bind_value %a.ref.loc56_24 -// CHECK:STDOUT: br !if.expr.result.loc56(%.loc56_24) +// CHECK:STDOUT: !if.expr.else.loc57: +// CHECK:STDOUT: %a.ref.loc57_24: ref %i32 = name_ref a, %a +// CHECK:STDOUT: %.loc57_24: %i32 = bind_value %a.ref.loc57_24 +// CHECK:STDOUT: br !if.expr.result.loc57(%.loc57_24) // CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc56: -// CHECK:STDOUT: %.loc56_4: %i32 = block_arg !if.expr.result.loc56 +// CHECK:STDOUT: !if.expr.result.loc57: +// CHECK:STDOUT: %.loc57_4: %i32 = block_arg !if.expr.result.loc57 // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10.64f] -// CHECK:STDOUT: %impl.elem0.loc56: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc56: = bound_method %int_10, %impl.elem0.loc56 [template = constants.%Convert.bound.491] -// CHECK:STDOUT: %Convert.specific_fn.loc56: = specific_function %Convert.bound.loc56, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.e67] -// CHECK:STDOUT: %int.convert_checked.loc56: init %i32 = call %Convert.specific_fn.loc56(%int_10) [template = constants.%int_10.265] -// CHECK:STDOUT: %.loc56_27: init %i32 = converted %int_10, %int.convert_checked.loc56 [template = constants.%int_10.265] -// CHECK:STDOUT: assign %.loc56_4, %.loc56_27 +// CHECK:STDOUT: %impl.elem0.loc57: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc57: = bound_method %int_10, %impl.elem0.loc57 [template = constants.%Convert.bound.491] +// CHECK:STDOUT: %Convert.specific_fn.loc57: = specific_function %Convert.bound.loc57, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.e67] +// CHECK:STDOUT: %int.convert_checked.loc57: init %i32 = call %Convert.specific_fn.loc57(%int_10) [template = constants.%int_10.265] +// CHECK:STDOUT: %.loc57_27: init %i32 = converted %int_10, %int.convert_checked.loc57 [template = constants.%int_10.265] +// CHECK:STDOUT: assign %.loc57_4, %.loc57_27 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon index cd4bd77a95f1..04850f00cb64 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -17,9 +17,10 @@ fn Main() { // CHECK:STDERR: ^~~~~ // CHECK:STDERR: a = a.(a); - // CHECK:STDERR: fail_redundant_compound_access.carbon:[[@LINE+3]]:7: error: member name of type `` in compound member access is not an instance member or an interface member [CompoundMemberAccessDoesNotUseBase] + // CHECK:STDERR: fail_redundant_compound_access.carbon:[[@LINE+4]]:7: error: member name of type `` in compound member access is not an instance member or an interface member [CompoundMemberAccessDoesNotUseBase] // CHECK:STDERR: a = a.(F)(); // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: a = a.(F)(); } @@ -102,11 +103,11 @@ fn Main() { // CHECK:STDOUT: %a.ref.loc19_10: ref %i32 = name_ref a, %a // CHECK:STDOUT: %.loc19: %i32 = bind_value %a.ref.loc19_10 // CHECK:STDOUT: assign %a.ref.loc19_3, %.loc19 -// CHECK:STDOUT: %a.ref.loc23_3: ref %i32 = name_ref a, %a -// CHECK:STDOUT: %a.ref.loc23_7: ref %i32 = name_ref a, %a +// CHECK:STDOUT: %a.ref.loc24_3: ref %i32 = name_ref a, %a +// CHECK:STDOUT: %a.ref.loc24_7: ref %i32 = name_ref a, %a // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %F.call: init %i32 = call %F.ref() -// CHECK:STDOUT: assign %a.ref.loc23_3, %F.call +// CHECK:STDOUT: assign %a.ref.loc24_3, %F.call // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index d11f4131fc72..905e10b379d2 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -9,12 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon fn Main() { - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:17: error: cannot implicitly convert from `Core.IntLiteral` to `bool` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:17: error: cannot implicitly convert from `Core.IntLiteral` to `bool` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: bool = not 12; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:17: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:17: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: bool = not 12; // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: var x: bool = not 12; } @@ -49,8 +50,8 @@ fn Main() { // CHECK:STDOUT: %x.var: ref bool = var x // CHECK:STDOUT: %x: ref bool = bind_name x, %x.var // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12] -// CHECK:STDOUT: %.loc18_17.1: bool = converted %int_12, [template = ] -// CHECK:STDOUT: %.loc18_17.2: = not [template = ] +// CHECK:STDOUT: %.loc19_17.1: bool = converted %int_12, [template = ] +// CHECK:STDOUT: %.loc19_17.2: = not [template = ] // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index b71ffdcb6cfa..851bed87236a 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -10,12 +10,13 @@ fn Main() { var a: i32 = 3; - // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: a = 5.6; // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+4]]:3: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: a = 5.6; // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: a = 5.6; } @@ -68,7 +69,7 @@ fn Main() { // CHECK:STDOUT: assign %a.var, %.loc12 // CHECK:STDOUT: %a.ref: ref %i32 = name_ref a, %a // CHECK:STDOUT: %float: f64 = float_literal 5.6000000000000005 [template = constants.%float] -// CHECK:STDOUT: %.loc19: %i32 = converted %float, [template = ] +// CHECK:STDOUT: %.loc20: %i32 = converted %float, [template = ] // CHECK:STDOUT: assign %a.ref, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon index ee7e9c3761a1..91dc89990883 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon @@ -11,9 +11,10 @@ fn Main() -> i32 { // The following line has two mismatches, but after the first, it shouldn't // keep erroring. - // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Core.Add` in type `{}` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.Add` in type `{}` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return {} + 3.4 + 12; // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: return {} + 3.4 + 12; } @@ -58,7 +59,7 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc17: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc18: %empty_struct_type = struct_literal () // CHECK:STDOUT: %float: f64 = float_literal 3.4000000000000004 [template = constants.%float] // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12] // CHECK:STDOUT: %impl.elem0: %Op.type = impl_witness_access , element0 [template = ] diff --git a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon index 023c25472562..cb64b68f63e2 100644 --- a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon fn Main() -> i32 { - // CHECK:STDERR: fail_unimplemented_op.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Core.Add` in type `{}` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_unimplemented_op.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.Add` in type `{}` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return {} + 34; // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: return {} + 34; } @@ -54,7 +55,7 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() -> %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc16: %empty_struct_type = struct_literal () // CHECK:STDOUT: %int_34: Core.IntLiteral = int_value 34 [template = constants.%int_34] // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index 79ddfa6cf794..e32385723dcb 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -76,9 +76,10 @@ fn TestRhsBad(a: C, b: D) -> bool { } fn TestLhsBad(a: D, b: C) -> bool { - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Core.Eq` in type `D` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.Eq` in type `D` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return a != b; // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: return a != b; } diff --git a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon index 54828c511060..aca915ded687 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -31,12 +31,13 @@ fn TestIncNonRef(a: C) { } fn TestAddAssignNonRef(a: C, b: C) { - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+6]]:3: error: `addr self` method cannot be invoked on a value [AddrSelfIsNonRef] + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+7]]:3: error: `addr self` method cannot be invoked on a value [AddrSelfIsNonRef] // CHECK:STDERR: a += b; // CHECK:STDERR: ^ // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-18]]:9: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: fn Op[addr self: C*](other: C); // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: a += b; } diff --git a/toolchain/check/testdata/operators/overloaded/fail_error_recovery.carbon b/toolchain/check/testdata/operators/overloaded/fail_error_recovery.carbon index f3cdce58b4ad..d2d4358780ab 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_error_recovery.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_error_recovery.carbon @@ -20,9 +20,10 @@ fn F() { } fn G(n: i32) { - // CHECK:STDERR: fail_error_recovery.carbon:[[@LINE+3]]:7: error: name `undeclared` not found [NameNotFound] + // CHECK:STDERR: fail_error_recovery.carbon:[[@LINE+4]]:7: error: name `undeclared` not found [NameNotFound] // CHECK:STDERR: n + undeclared; // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: n + undeclared; } diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon index e93fcf452491..d79cb154b5f5 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon @@ -35,9 +35,10 @@ fn TestRef(b: C) { // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: a += b; - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+3]]:3: error: cannot access member of interface `Core.Inc` in type `C` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.Inc` in type `C` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: ++a; // CHECK:STDERR: ^~~ + // CHECK:STDERR: ++a; } @@ -146,7 +147,7 @@ fn TestRef(b: C) { // CHECK:STDOUT: assign %a.var, %.loc32_16 // CHECK:STDOUT: %a.ref.loc37: ref %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %a.ref.loc41: ref %C = name_ref a, %a +// CHECK:STDOUT: %a.ref.loc42: ref %C = name_ref a, %a // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index 901ee85a6047..828f0c4710e0 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -36,15 +36,16 @@ fn Test(a: C, b: D) -> C { fn TestAssign(b: D) { var a: C = {}; - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+9]]:8: error: cannot implicitly convert from `D` to `C` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+10]]:8: error: cannot implicitly convert from `D` to `C` [ImplicitAsConversionFailure] // CHECK:STDERR: a += b; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+6]]:8: note: type `D` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+7]]:8: note: type `D` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessNote] // CHECK:STDERR: a += b; // CHECK:STDERR: ^ // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-25]]:24: note: initializing function parameter [InCallToFunctionParam] // CHECK:STDERR: fn Op[addr self: C*](other: C); // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: a += b; } @@ -225,7 +226,7 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %impl.elem0: %Op.type.421 = impl_witness_access constants.%impl_witness.95d, element0 [template = constants.%Op.d8e] // CHECK:STDOUT: %Op.bound: = bound_method %a.ref, %impl.elem0 // CHECK:STDOUT: %addr: %ptr.019 = addr_of %a.ref -// CHECK:STDOUT: %.loc48: %C = converted %b.ref, [template = ] +// CHECK:STDOUT: %.loc49: %C = converted %b.ref, [template = ] // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %Op.bound(%addr, ) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 69ae40aa6b7c..573c14bf639f 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -70,9 +70,10 @@ library "[[@TEST_NAME]]"; class C { } let c: C = {}; -// CHECK:STDERR: fail_index_with_not_implemented.carbon:[[@LINE+3]]:14: error: type `C` does not support indexing [TypeNotIndexable] +// CHECK:STDERR: fail_index_with_not_implemented.carbon:[[@LINE+4]]:14: error: type `C` does not support indexing [TypeNotIndexable] // CHECK:STDERR: let x: i32 = c[0]; // CHECK:STDERR: ^~~~ +// CHECK:STDERR: let x: i32 = c[0]; diff --git a/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon b/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon index ed7af649caea..730fbdf62c5a 100644 --- a/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon @@ -24,13 +24,14 @@ fn F() { 0[1]; } library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_missing_index_with.carbon:[[@LINE+7]]:10: error: `Core.IndexWith` implicitly referenced here, but package `Core` not found [CoreNotFound] +// CHECK:STDERR: fail_missing_index_with.carbon:[[@LINE+8]]:10: error: `Core.IndexWith` implicitly referenced here, but package `Core` not found [CoreNotFound] // CHECK:STDERR: fn F() { 0[1]; } // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_missing_index_with.carbon:[[@LINE+3]]:10: error: type `Core.IntLiteral` does not support indexing [TypeNotIndexable] +// CHECK:STDERR: fail_missing_index_with.carbon:[[@LINE+4]]:10: error: type `Core.IntLiteral` does not support indexing [TypeNotIndexable] // CHECK:STDERR: fn F() { 0[1]; } // CHECK:STDERR: ^~~~ +// CHECK:STDERR: fn F() { 0[1]; } // --- wrong_arg_count.carbon diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index e4e38b0a9e08..21eba8658196 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -68,9 +68,10 @@ fn TestGreater(a: D, b: D) -> bool { } fn TestGreaterEqual(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Core.Ordered` in type `D` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.Ordered` in type `D` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: return a >= b; // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: return a >= b; } diff --git a/toolchain/check/testdata/package_expr/fail_not_found.carbon b/toolchain/check/testdata/package_expr/fail_not_found.carbon index e379190c621c..4a0edc8bd503 100644 --- a/toolchain/check/testdata/package_expr/fail_not_found.carbon +++ b/toolchain/check/testdata/package_expr/fail_not_found.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/package_expr/fail_not_found.carbon fn Main() { - // CHECK:STDERR: fail_not_found.carbon:[[@LINE+3]]:16: error: member name `x` not found in `package` [MemberNameNotFoundInScope] + // CHECK:STDERR: fail_not_found.carbon:[[@LINE+4]]:16: error: member name `x` not found in `package` [MemberNameNotFoundInScope] // CHECK:STDERR: var y: i32 = package.x; // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: var y: i32 = package.x; } diff --git a/toolchain/check/testdata/packages/fail_api_not_found.carbon b/toolchain/check/testdata/packages/fail_api_not_found.carbon index 1d91169ffe34..d29ba279514a 100644 --- a/toolchain/check/testdata/packages/fail_api_not_found.carbon +++ b/toolchain/check/testdata/packages/fail_api_not_found.carbon @@ -26,9 +26,10 @@ impl package Foo library "[[@TEST_NAME]]"; // --- fail_no_api_main_lib.impl.carbon -// CHECK:STDERR: fail_no_api_main_lib.impl.carbon:[[@LINE+3]]:6: error: corresponding API for 'Main//no_api_main_lib' not found [LibraryApiNotFound] +// CHECK:STDERR: fail_no_api_main_lib.impl.carbon:[[@LINE+4]]:6: error: corresponding API for 'Main//no_api_main_lib' not found [LibraryApiNotFound] // CHECK:STDERR: impl library "no_api_main_lib"; // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: impl library "[[@TEST_NAME]]"; // CHECK:STDOUT: --- fail_no_api.impl.carbon diff --git a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon index 844d752c3227..9d2f37ae46b5 100644 --- a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon +++ b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon @@ -24,14 +24,15 @@ var Foo: i32; package Example library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: in import [InImport] +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:1: in import [InImport] // CHECK:STDERR: var.carbon:4:5: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: var Foo: i32; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1: in import [InImport] +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+5]]:1: in import [InImport] // CHECK:STDERR: fn.carbon:4:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: fn Foo(); // CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: import library "fn"; import library "var"; diff --git a/toolchain/check/testdata/packages/fail_cycle.carbon b/toolchain/check/testdata/packages/fail_cycle.carbon index abe2a41511cf..910bfbb1d98f 100644 --- a/toolchain/check/testdata/packages/fail_cycle.carbon +++ b/toolchain/check/testdata/packages/fail_cycle.carbon @@ -50,9 +50,10 @@ impl package C; package CycleChild; -// CHECK:STDERR: fail_cycle_child.carbon:[[@LINE+3]]:1: error: import cannot be used due to a cycle; cycle must be fixed to import [ImportCycleDetected] +// CHECK:STDERR: fail_cycle_child.carbon:[[@LINE+4]]:1: error: import cannot be used due to a cycle; cycle must be fixed to import [ImportCycleDetected] // CHECK:STDERR: import B; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: import B; // CHECK:STDOUT: --- fail_a.carbon diff --git a/toolchain/check/testdata/packages/fail_duplicate_api.carbon b/toolchain/check/testdata/packages/fail_duplicate_api.carbon index da19cec46950..3c4bd0f4453d 100644 --- a/toolchain/check/testdata/packages/fail_duplicate_api.carbon +++ b/toolchain/check/testdata/packages/fail_duplicate_api.carbon @@ -44,9 +44,10 @@ package Package library "lib"; // --- fail_package_lib2.carbon -// CHECK:STDERR: fail_package_lib2.carbon:[[@LINE+3]]:1: error: library's API previously provided by `package_lib1.carbon` [DuplicateLibraryApi] +// CHECK:STDERR: fail_package_lib2.carbon:[[@LINE+4]]:1: error: library's API previously provided by `package_lib1.carbon` [DuplicateLibraryApi] // CHECK:STDERR: package Package library "lib"; // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: package Package library "lib"; // CHECK:STDOUT: --- main1.carbon diff --git a/toolchain/check/testdata/packages/fail_extension.carbon b/toolchain/check/testdata/packages/fail_extension.carbon index 400aa6008539..ef799d6ab49a 100644 --- a/toolchain/check/testdata/packages/fail_extension.carbon +++ b/toolchain/check/testdata/packages/fail_extension.carbon @@ -78,9 +78,10 @@ package SwappedExt; // --- fail_swapped_ext.carbon -// CHECK:STDERR: fail_swapped_ext.carbon:[[@LINE+3]]:6: error: file extension of `.impl.carbon` required for `impl` [IncorrectExtension] +// CHECK:STDERR: fail_swapped_ext.carbon:[[@LINE+4]]:6: error: file extension of `.impl.carbon` required for `impl` [IncorrectExtension] // CHECK:STDERR: impl package SwappedExt; // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: impl package SwappedExt; diff --git a/toolchain/check/testdata/packages/fail_import_default.carbon b/toolchain/check/testdata/packages/fail_import_default.carbon index 6e76196ab86d..3e655e4d2b20 100644 --- a/toolchain/check/testdata/packages/fail_import_default.carbon +++ b/toolchain/check/testdata/packages/fail_import_default.carbon @@ -40,9 +40,10 @@ import library default; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_main_lib_import_default.carbon:[[@LINE+3]]:1: error: cannot import `Main//default` [ImportMainDefaultLibrary] +// CHECK:STDERR: fail_main_lib_import_default.carbon:[[@LINE+4]]:1: error: cannot import `Main//default` [ImportMainDefaultLibrary] // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: import library default; // CHECK:STDOUT: --- fail_default_api.carbon diff --git a/toolchain/check/testdata/packages/fail_import_invalid.carbon b/toolchain/check/testdata/packages/fail_import_invalid.carbon index 430e14d10cd4..16f7a519df76 100644 --- a/toolchain/check/testdata/packages/fail_import_invalid.carbon +++ b/toolchain/check/testdata/packages/fail_import_invalid.carbon @@ -89,9 +89,10 @@ import Implicit library "implicit_lib"; // --- fail_not_found.carbon package NotFound; -// CHECK:STDERR: fail_not_found.carbon:[[@LINE+3]]:1: error: imported API 'ImportNotFound' not found [ImportNotFound] +// CHECK:STDERR: fail_not_found.carbon:[[@LINE+4]]:1: error: imported API 'ImportNotFound' not found [ImportNotFound] // CHECK:STDERR: import ImportNotFound; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: import ImportNotFound; // CHECK:STDOUT: --- fail_main.carbon diff --git a/toolchain/check/testdata/packages/fail_import_repeat.carbon b/toolchain/check/testdata/packages/fail_import_repeat.carbon index 2fb567ed1fc8..52e839066bc9 100644 --- a/toolchain/check/testdata/packages/fail_import_repeat.carbon +++ b/toolchain/check/testdata/packages/fail_import_repeat.carbon @@ -57,12 +57,13 @@ import library "main_lib"; package Api library "[[@TEST_NAME]]"; import library default; -// CHECK:STDERR: fail_default_import.carbon:[[@LINE+6]]:1: error: library imported more than once [RepeatedImport] +// CHECK:STDERR: fail_default_import.carbon:[[@LINE+7]]:1: error: library imported more than once [RepeatedImport] // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_default_import.carbon:[[@LINE-4]]:1: note: first import here [FirstImported] // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: import library default; // CHECK:STDOUT: --- api.carbon diff --git a/toolchain/check/testdata/packages/fail_import_type_error.carbon b/toolchain/check/testdata/packages/fail_import_type_error.carbon index 2234b3d2d675..152f3dffa70f 100644 --- a/toolchain/check/testdata/packages/fail_import_type_error.carbon +++ b/toolchain/check/testdata/packages/fail_import_type_error.carbon @@ -27,9 +27,10 @@ var b_ref: {.a = x}; // CHECK:STDERR: ^ // CHECK:STDERR: var c_ref: (x,); -// CHECK:STDERR: fail_implicit.carbon:[[@LINE+3]]:12: error: name `x` not found [NameNotFound] +// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:12: error: name `x` not found [NameNotFound] // CHECK:STDERR: var d_ref: x*; // CHECK:STDERR: ^ +// CHECK:STDERR: var d_ref: x*; // --- implicit.impl.carbon diff --git a/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon b/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon index 08bb03e9f6d4..7b0eba2e4466 100644 --- a/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon +++ b/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon @@ -10,9 +10,10 @@ // --- fail_implicit.impl.carbon -// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:6: error: corresponding API for 'Implicit' not found [LibraryApiNotFound] +// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+4]]:6: error: corresponding API for 'Implicit' not found [LibraryApiNotFound] // CHECK:STDERR: impl package Implicit; // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: impl package Implicit; var a: () = A(); diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon index fe3f724ae568..19b4169f7a9d 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon @@ -186,9 +186,10 @@ library "[[@TEST_NAME]]"; import Other library "export_name"; import Other library "conflict"; -// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+3]]:11: note: in name lookup for `C` [InNameLookup] +// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+4]]:11: note: in name lookup for `C` [InNameLookup] // CHECK:STDERR: alias C = Other.C; // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: alias C = Other.C; // CHECK:STDOUT: --- base.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon index 285c1cd2b597..fb15256ebe7d 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon @@ -201,9 +201,10 @@ library "[[@TEST_NAME]]"; import Other library "other_fn_use"; -// CHECK:STDERR: fail_use_other_fn_use.carbon:[[@LINE+3]]:13: error: member name `F` not found in `Other` [MemberNameNotFoundInScope] +// CHECK:STDERR: fail_use_other_fn_use.carbon:[[@LINE+4]]:13: error: member name `F` not found in `Other` [MemberNameNotFoundInScope] // CHECK:STDERR: fn UseF() { Other.F(); } // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: fn UseF() { Other.F(); } // CHECK:STDOUT: --- other_fn.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/export_import.carbon b/toolchain/check/testdata/packages/no_prelude/export_import.carbon index 9a68d54e70fc..1acf11e46796 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_import.carbon @@ -148,9 +148,10 @@ library "[[@TEST_NAME]]"; import library "non_export"; -// CHECK:STDERR: fail_use_non_export.carbon:[[@LINE+3]]:15: error: name `C` not found [NameNotFound] +// CHECK:STDERR: fail_use_non_export.carbon:[[@LINE+4]]:15: error: name `C` not found [NameNotFound] // CHECK:STDERR: alias Local = C; // CHECK:STDERR: ^ +// CHECK:STDERR: alias Local = C; // --- use_non_export_then_base.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon index 1859645e7264..795cfe4f3ba4 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon @@ -88,9 +88,10 @@ library "[[@TEST_NAME]]"; import library "export_import_then_name"; import library "export_name_then_import"; -// CHECK:STDERR: fail_nonexport_use_both.carbon:[[@LINE+3]]:8: error: name `D` not found [NameNotFound] +// CHECK:STDERR: fail_nonexport_use_both.carbon:[[@LINE+4]]:8: error: name `D` not found [NameNotFound] // CHECK:STDERR: var d: D = {.y = ()}; // CHECK:STDERR: ^ +// CHECK:STDERR: var d: D = {.y = ()}; // --- use_both_reversed.carbon @@ -384,8 +385,8 @@ var d: D = {.y = ()}; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc10_19: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_20: %struct_type.y = struct_literal (%.loc10_19) +// CHECK:STDOUT: %.loc11_19: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc11_20: %struct_type.y = struct_literal (%.loc11_19) // CHECK:STDOUT: assign file.%d.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/no_prelude/export_name.carbon b/toolchain/check/testdata/packages/no_prelude/export_name.carbon index b334ef2a1edd..1eeb733a4812 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_name.carbon @@ -195,9 +195,10 @@ library "[[@TEST_NAME]]"; import library "base"; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `private` not allowed on `export` declaration [ModifierNotAllowedOnDeclaration] +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `private` not allowed on `export` declaration [ModifierNotAllowedOnDeclaration] // CHECK:STDERR: private export C; // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: private export C; // CHECK:STDOUT: --- base.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon index 0c912103fc3d..7061dfb2467d 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon @@ -24,13 +24,14 @@ import library "a"; // TODO: This diagnostic doesn't clearly explain the problem. We should instead // say something like: Only namespace-scope names can be exported. -// CHECK:STDERR: fail_b.carbon:[[@LINE+7]]:8: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope] +// CHECK:STDERR: fail_b.carbon:[[@LINE+8]]:8: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope] // CHECK:STDERR: export C.n; // CHECK:STDERR: ^ // CHECK:STDERR: fail_b.carbon:[[@LINE-7]]:1: in import [InImport] // CHECK:STDERR: a.carbon:4:1: note: referenced non-scope entity declared here [QualifiedNameNonScopeEntity] // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: export C.n; // CHECK:STDOUT: --- a.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon index 9f30016e2f6c..195804a01541 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon @@ -23,9 +23,10 @@ import library "a"; export C1; -// CHECK:STDERR: fail_b.carbon:[[@LINE+3]]:10: error: `export` declaration cannot have parameters [UnexpectedDeclNameParams] +// CHECK:STDERR: fail_b.carbon:[[@LINE+4]]:10: error: `export` declaration cannot have parameters [UnexpectedDeclNameParams] // CHECK:STDERR: export C2(T:! type); // CHECK:STDERR: ^~~~~~~~~~ +// CHECK:STDERR: export C2(T:! type); // CHECK:STDOUT: --- a.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon index a069d2c40efa..7487309c25b2 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon @@ -90,13 +90,14 @@ virtual import VirtualImport; // CHECK:STDERR: base import BaseImport; -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+7]]:9: error: imported API 'PrivateImport' not found [ImportNotFound] +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:9: error: imported API 'PrivateImport' not found [ImportNotFound] // CHECK:STDERR: private import PrivateImport; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+3]]:1: error: `private` not allowed on `import` declaration [ModifierNotAllowedOnDeclaration] +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:1: error: `private` not allowed on `import` declaration [ModifierNotAllowedOnDeclaration] // CHECK:STDERR: private import PrivateImport; // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: private import PrivateImport; // CHECK:STDOUT: --- fail_export_package.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon index adc9f0cc92ac..2d6fe65f8872 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +++ b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon @@ -154,7 +154,7 @@ import library "local_other"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] +// CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE+9]]:1: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: import Other library "o1"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE-5]]:6: in import [InImport] @@ -162,6 +162,7 @@ impl library "[[@TEST_NAME]]"; // CHECK:STDERR: local_other.carbon:4:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: class Other {} // CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: import Other library "o1"; // CHECK:STDOUT: --- c1.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon index 37410b783eb2..e63233937b79 100644 --- a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon @@ -80,9 +80,10 @@ class Core { fn Int[T:! type](N:! T) -> {} { return {}; } } -// CHECK:STDERR: fail_prelude_as_class.carbon:[[@LINE+3]]:13: error: `Core.Int` implicitly referenced here, but package `Core` not found [CoreNotFound] +// CHECK:STDERR: fail_prelude_as_class.carbon:[[@LINE+4]]:13: error: `Core.Int` implicitly referenced here, but package `Core` not found [CoreNotFound] // CHECK:STDERR: var n: {} = i32; // CHECK:STDERR: ^~~ +// CHECK:STDERR: var n: {} = i32; // CHECK:STDOUT: --- fail_missing_prelude.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/restricted_package_names.carbon b/toolchain/check/testdata/packages/no_prelude/restricted_package_names.carbon index b6286957e80c..a7a9d87b7d42 100644 --- a/toolchain/check/testdata/packages/no_prelude/restricted_package_names.carbon +++ b/toolchain/check/testdata/packages/no_prelude/restricted_package_names.carbon @@ -82,9 +82,10 @@ package r#Cpp; // --- fail_cpp_lib.carbon -// CHECK:STDERR: fail_cpp_lib.carbon:[[@LINE+3]]:1: error: `Cpp` cannot be used by a `package` declaration [CppPackageDeclaration] +// CHECK:STDERR: fail_cpp_lib.carbon:[[@LINE+4]]:1: error: `Cpp` cannot be used by a `package` declaration [CppPackageDeclaration] // CHECK:STDERR: package Cpp library "cpp_lib"; // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: package Cpp library "[[@TEST_NAME]]"; // CHECK:STDOUT: --- lowercase_main.carbon diff --git a/toolchain/check/testdata/pointer/fail_address_of_error.carbon b/toolchain/check/testdata/pointer/fail_address_of_error.carbon index a21209140f08..fe5c405f2732 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_error.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_error.carbon @@ -14,13 +14,14 @@ fn Test() { // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: &undeclared; - // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+7]]:6: error: name `undeclared` not found [NameNotFound] + // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+8]]:6: error: name `undeclared` not found [NameNotFound] // CHECK:STDERR: &(&undeclared); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+3]]:3: error: cannot take the address of non-reference expression [AddrOfNonRef] + // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: &(&undeclared); // CHECK:STDERR: ^ + // CHECK:STDERR: &(&undeclared); } @@ -51,9 +52,9 @@ fn Test() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %undeclared.ref.loc16: = name_ref undeclared, [template = ] // CHECK:STDOUT: %addr.loc16: = addr_of %undeclared.ref.loc16 [template = ] -// CHECK:STDOUT: %undeclared.ref.loc24: = name_ref undeclared, [template = ] -// CHECK:STDOUT: %addr.loc24_5: = addr_of %undeclared.ref.loc24 [template = ] -// CHECK:STDOUT: %addr.loc24_3: = addr_of [template = ] +// CHECK:STDOUT: %undeclared.ref.loc25: = name_ref undeclared, [template = ] +// CHECK:STDOUT: %addr.loc25_5: = addr_of %undeclared.ref.loc25 [template = ] +// CHECK:STDOUT: %addr.loc25_3: = addr_of [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index c99b905b2d46..003f7764dcb1 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -93,9 +93,10 @@ fn AddressOfTupleElementValue() { } fn AddressOfParam(param: i32) { - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:26: error: cannot take the address of non-reference expression [AddrOfNonRef] + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:26: error: cannot take the address of non-reference expression [AddrOfNonRef] // CHECK:STDERR: var param_addr: i32* = ¶m; // CHECK:STDERR: ^ + // CHECK:STDERR: var param_addr: i32* = ¶m; } diff --git a/toolchain/check/testdata/pointer/fail_deref_error.carbon b/toolchain/check/testdata/pointer/fail_deref_error.carbon index 31473a4c01cd..eb729017bd1f 100644 --- a/toolchain/check/testdata/pointer/fail_deref_error.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_error.carbon @@ -13,9 +13,10 @@ // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: let n: i32 = *undeclared; -// CHECK:STDERR: fail_deref_error.carbon:[[@LINE+3]]:15: error: name `undeclared` not found [NameNotFound] +// CHECK:STDERR: fail_deref_error.carbon:[[@LINE+4]]:15: error: name `undeclared` not found [NameNotFound] // CHECK:STDERR: let n2: i32 = undeclared->foo; // CHECK:STDERR: ^~~~~~~~~~ +// CHECK:STDERR: let n2: i32 = undeclared->foo; // CHECK:STDOUT: --- fail_deref_error.carbon @@ -47,8 +48,8 @@ let n2: i32 = undeclared->foo; // CHECK:STDOUT: %undeclared.ref.loc15: = name_ref undeclared, [template = ] // CHECK:STDOUT: %.loc15: ref = deref // CHECK:STDOUT: %n: %i32 = bind_name n, -// CHECK:STDOUT: %undeclared.ref.loc19: = name_ref undeclared, [template = ] -// CHECK:STDOUT: %.loc19: ref = deref +// CHECK:STDOUT: %undeclared.ref.loc20: = name_ref undeclared, [template = ] +// CHECK:STDOUT: %.loc20: ref = deref // CHECK:STDOUT: %foo.ref: = name_ref foo, [template = ] // CHECK:STDOUT: %n2: %i32 = bind_name n2, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/pointer/fail_deref_function.carbon b/toolchain/check/testdata/pointer/fail_deref_function.carbon index e5581afc0b75..7d8149dc00d2 100644 --- a/toolchain/check/testdata/pointer/fail_deref_function.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_function.carbon @@ -14,9 +14,10 @@ fn A() { // CHECK:STDERR: ^ // CHECK:STDERR: *A; - // CHECK:STDERR: fail_deref_function.carbon:[[@LINE+3]]:3: error: expression cannot be used as a value [UseOfNonExprAsValue] + // CHECK:STDERR: fail_deref_function.carbon:[[@LINE+4]]:3: error: expression cannot be used as a value [UseOfNonExprAsValue] // CHECK:STDERR: A->foo; // CHECK:STDERR: ^ + // CHECK:STDERR: A->foo; } @@ -47,8 +48,8 @@ fn A() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %A.ref.loc16: %A.type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc16: ref = deref -// CHECK:STDOUT: %A.ref.loc20: %A.type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc20: ref = deref +// CHECK:STDOUT: %A.ref.loc21: %A.type = name_ref A, file.%A.decl [template = constants.%A] +// CHECK:STDOUT: %.loc21: ref = deref // CHECK:STDOUT: %foo.ref: = name_ref foo, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_deref_namespace.carbon b/toolchain/check/testdata/pointer/fail_deref_namespace.carbon index 70209f14436f..ebb69f15813c 100644 --- a/toolchain/check/testdata/pointer/fail_deref_namespace.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_namespace.carbon @@ -16,9 +16,10 @@ fn F() { // CHECK:STDERR: ^ // CHECK:STDERR: *A; - // CHECK:STDERR: fail_deref_namespace.carbon:[[@LINE+3]]:3: error: expression cannot be used as a value [UseOfNonExprAsValue] + // CHECK:STDERR: fail_deref_namespace.carbon:[[@LINE+4]]:3: error: expression cannot be used as a value [UseOfNonExprAsValue] // CHECK:STDERR: A->foo; // CHECK:STDERR: ^ + // CHECK:STDERR: A->foo; } @@ -51,8 +52,8 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %A.ref.loc18: = name_ref A, file.%A [template = file.%A] // CHECK:STDOUT: %.loc18: ref = deref -// CHECK:STDOUT: %A.ref.loc22: = name_ref A, file.%A [template = file.%A] -// CHECK:STDOUT: %.loc22: ref = deref +// CHECK:STDOUT: %A.ref.loc23: = name_ref A, file.%A [template = file.%A] +// CHECK:STDOUT: %.loc23: ref = deref // CHECK:STDOUT: %foo.ref: = name_ref foo, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon index 0d78d003e1e0..38c6f51e06ee 100644 --- a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon @@ -34,9 +34,10 @@ fn Deref(n: i32) { // CHECK:STDERR: ^ // CHECK:STDERR: *{}; - // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+3]]:5: error: cannot apply `->` operator to non-pointer type `{}` [ArrowOperatorOfNonPointer] + // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:5: error: cannot apply `->` operator to non-pointer type `{}` [ArrowOperatorOfNonPointer] // CHECK:STDERR: {}->foo; // CHECK:STDERR: ^~ + // CHECK:STDERR: {}->foo; } @@ -100,11 +101,11 @@ fn Deref(n: i32) { // CHECK:STDOUT: %empty_struct.loc36: %empty_struct_type = struct_value () [template = constants.%empty_struct] // CHECK:STDOUT: %.loc36_5.2: %empty_struct_type = converted %.loc36_5.1, %empty_struct.loc36 [template = constants.%empty_struct] // CHECK:STDOUT: %.loc36_3: ref = deref %.loc36_5.2 -// CHECK:STDOUT: %.loc40_4.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %empty_struct.loc40: %empty_struct_type = struct_value () [template = constants.%empty_struct] -// CHECK:STDOUT: %.loc40_4.2: %empty_struct_type = converted %.loc40_4.1, %empty_struct.loc40 [template = constants.%empty_struct] -// CHECK:STDOUT: %.loc40_5: ref = deref %.loc40_4.2 -// CHECK:STDOUT: %foo.ref.loc40: = name_ref foo, [template = ] +// CHECK:STDOUT: %.loc41_4.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %empty_struct.loc41: %empty_struct_type = struct_value () [template = constants.%empty_struct] +// CHECK:STDOUT: %.loc41_4.2: %empty_struct_type = converted %.loc41_4.1, %empty_struct.loc41 [template = constants.%empty_struct] +// CHECK:STDOUT: %.loc41_5: ref = deref %.loc41_4.2 +// CHECK:STDOUT: %foo.ref.loc41: = name_ref foo, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/fail_deref_type.carbon b/toolchain/check/testdata/pointer/fail_deref_type.carbon index 7ad5b4df857f..4eed4031172d 100644 --- a/toolchain/check/testdata/pointer/fail_deref_type.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_type.carbon @@ -16,9 +16,10 @@ // CHECK:STDERR: ^ // CHECK:STDERR: var p: *i32; -// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+3]]:12: error: cannot apply `->` operator to non-pointer type `type` [ArrowOperatorOfNonPointer] +// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+4]]:12: error: cannot apply `->` operator to non-pointer type `type` [ArrowOperatorOfNonPointer] // CHECK:STDERR: var p2: i32->foo; // CHECK:STDERR: ^~ +// CHECK:STDERR: var p2: i32->foo; // CHECK:STDOUT: --- fail_deref_type.carbon diff --git a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon index c81f6f0a8f6b..7a6b001ebb28 100644 --- a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon @@ -9,12 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_type_mismatch.carbon fn ConstMismatch(p: const {}*) -> const ({}*) { - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `const {}*` to `const ({}*)` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `const {}*` to `const ({}*)` [ImplicitAsConversionFailure] // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: note: type `const {}*` does not implement interface `Core.ImplicitAs(const ({}*))` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:3: note: type `const {}*` does not implement interface `Core.ImplicitAs(const ({}*))` [MissingImplInMemberAccessNote] // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: return p; } @@ -70,7 +71,7 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: fn @ConstMismatch(%p.param_patt: %ptr.bf9) -> %const.987 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.ref: %ptr.bf9 = name_ref p, %p -// CHECK:STDOUT: %.loc18: %const.987 = converted %p.ref, [template = ] +// CHECK:STDOUT: %.loc19: %const.987 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_call_in_type.carbon b/toolchain/check/testdata/return/fail_call_in_type.carbon index 7efa416bae39..2849c0682ac2 100644 --- a/toolchain/check/testdata/return/fail_call_in_type.carbon +++ b/toolchain/check/testdata/return/fail_call_in_type.carbon @@ -11,9 +11,10 @@ // TODO: Some variant of this should work, once compile-time function calls are // supported. fn ReturnType() -> type { return i32; } -// CHECK:STDERR: fail_call_in_type.carbon:[[@LINE+3]]:13: error: cannot evaluate type expression [TypeExprEvaluationFailure] +// CHECK:STDERR: fail_call_in_type.carbon:[[@LINE+4]]:13: error: cannot evaluate type expression [TypeExprEvaluationFailure] // CHECK:STDERR: fn Six() -> ReturnType() { return 6; } // CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: fn Six() -> ReturnType() { return 6; } // CHECK:STDOUT: --- fail_call_in_type.carbon @@ -56,8 +57,8 @@ fn Six() -> ReturnType() { return 6; } // CHECK:STDOUT: } { // CHECK:STDOUT: %ReturnType.ref: %ReturnType.type = name_ref ReturnType, file.%ReturnType.decl [template = constants.%ReturnType] // CHECK:STDOUT: %ReturnType.call: init type = call %ReturnType.ref() -// CHECK:STDOUT: %.loc17_24.1: type = value_of_initializer %ReturnType.call -// CHECK:STDOUT: %.loc17_24.2: type = converted %ReturnType.call, %.loc17_24.1 +// CHECK:STDOUT: %.loc18_24.1: type = value_of_initializer %ReturnType.call +// CHECK:STDOUT: %.loc18_24.2: type = converted %ReturnType.call, %.loc18_24.1 // CHECK:STDOUT: %return.param: ref = out_param runtime_param0 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_error_in_type.carbon b/toolchain/check/testdata/return/fail_error_in_type.carbon index 9e66a4eb950d..ebcf90a38f21 100644 --- a/toolchain/check/testdata/return/fail_error_in_type.carbon +++ b/toolchain/check/testdata/return/fail_error_in_type.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_error_in_type.carbon -// CHECK:STDERR: fail_error_in_type.carbon:[[@LINE+3]]:13: error: name `x` not found [NameNotFound] +// CHECK:STDERR: fail_error_in_type.carbon:[[@LINE+4]]:13: error: name `x` not found [NameNotFound] // CHECK:STDERR: fn Six() -> x; // CHECK:STDERR: ^ +// CHECK:STDERR: fn Six() -> x; // CHECK:STDOUT: --- fail_error_in_type.carbon diff --git a/toolchain/check/testdata/return/fail_let_in_type.carbon b/toolchain/check/testdata/return/fail_let_in_type.carbon index 1a40e50f9e77..29c65b61ef5a 100644 --- a/toolchain/check/testdata/return/fail_let_in_type.carbon +++ b/toolchain/check/testdata/return/fail_let_in_type.carbon @@ -28,13 +28,14 @@ let y:! type = i32; fn HalfDozen() -> y { return 6; } // TODO: This should work. -// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+7]]:14: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo] +// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+8]]:14: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo] // CHECK:STDERR: let template z:! type = i32; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+3]]:5: error: semantics TODO: `HandleTemplate` [SemanticsTodo] +// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+4]]:5: error: semantics TODO: `HandleTemplate` [SemanticsTodo] // CHECK:STDERR: let template z:! type = i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ +// CHECK:STDERR: let template z:! type = i32; fn FirstPerfectNumber() -> z { return 6; } diff --git a/toolchain/check/testdata/return/fail_missing_return.carbon b/toolchain/check/testdata/return/fail_missing_return.carbon index e0c3f0d4738f..86efed946192 100644 --- a/toolchain/check/testdata/return/fail_missing_return.carbon +++ b/toolchain/check/testdata/return/fail_missing_return.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_missing_return.carbon fn Main() -> i32 { -// CHECK:STDERR: fail_missing_return.carbon:[[@LINE+3]]:1: error: missing `return` at end of function with declared return type [MissingReturnStatement] +// CHECK:STDERR: fail_missing_return.carbon:[[@LINE+4]]:1: error: missing `return` at end of function with declared return type [MissingReturnStatement] // CHECK:STDERR: } // CHECK:STDERR: ^ +// CHECK:STDERR: } // CHECK:STDOUT: --- fail_missing_return.carbon diff --git a/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon b/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon index 2bd80879d317..7f46e46a71f6 100644 --- a/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon +++ b/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon fn F() -> () { -// CHECK:STDERR: fail_missing_return_empty_tuple.carbon:[[@LINE+3]]:1: error: missing `return` at end of function with declared return type [MissingReturnStatement] +// CHECK:STDERR: fail_missing_return_empty_tuple.carbon:[[@LINE+4]]:1: error: missing `return` at end of function with declared return type [MissingReturnStatement] // CHECK:STDERR: } // CHECK:STDERR: ^ +// CHECK:STDERR: } // CHECK:STDOUT: --- fail_missing_return_empty_tuple.carbon diff --git a/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon b/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon index 4fce34992101..92ef87a28b32 100644 --- a/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon fn Procedure() -> i32 { - // CHECK:STDERR: fail_return_var_no_returned_var.carbon:[[@LINE+3]]:3: error: `return var;` with no `returned var` in scope [ReturnVarWithNoReturnedVar] + // CHECK:STDERR: fail_return_var_no_returned_var.carbon:[[@LINE+4]]:3: error: `return var;` with no `returned var` in scope [ReturnVarWithNoReturnedVar] // CHECK:STDERR: return var; // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: return var; } diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index db7ce6a500f3..408147c55ef4 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -23,12 +23,13 @@ fn F() -> i32 { class C { var a: i32; var b: i32; } fn G() -> C { returned var c: C = {.a = 1, .b = 2}; - // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE+6]]:3: error: can only `return var;` in the scope of a `returned var` [ReturnExprWithReturnedVar] + // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE+7]]:3: error: can only `return var;` in the scope of a `returned var` [ReturnExprWithReturnedVar] // CHECK:STDERR: return c; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE-4]]:16: note: `returned var` was declared here [ReturnedVarHere] // CHECK:STDERR: returned var c: C = {.a = 1, .b = 2}; // CHECK:STDERR: ^ + // CHECK:STDERR: return c; } diff --git a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon index 08478b66afd4..f6895e57a92a 100644 --- a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon @@ -29,12 +29,13 @@ fn Procedure() { library "[[@TEST_NAME]]"; fn ForgotReturnType() { - // CHECK:STDERR: fail_forgot_return_type.carbon:[[@LINE+6]]:3: error: cannot declare a `returned var` in this function [ReturnedVarWithNoReturnType] + // CHECK:STDERR: fail_forgot_return_type.carbon:[[@LINE+7]]:3: error: cannot declare a `returned var` in this function [ReturnedVarWithNoReturnType] // CHECK:STDERR: returned var v: () = (); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_forgot_return_type.carbon:[[@LINE-4]]:1: note: there was no return type provided [ReturnTypeOmittedNote] // CHECK:STDERR: fn ForgotReturnType() { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: returned var v: () = (); return var; } @@ -99,10 +100,10 @@ fn ForgotReturnType() { // CHECK:STDOUT: fn @ForgotReturnType() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %v: %empty_tuple.type = bind_name v, -// CHECK:STDOUT: %.loc11_25: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc12_25: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: assign , // CHECK:STDOUT: %tuple: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc11_16: %empty_tuple.type = converted %v, %tuple [template = constants.%empty_tuple] -// CHECK:STDOUT: return %.loc11_16 +// CHECK:STDOUT: %.loc12_16: %empty_tuple.type = converted %v, %tuple [template = constants.%empty_tuple] +// CHECK:STDOUT: return %.loc12_16 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index 39662c03dc78..8fad920ffb07 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -27,12 +27,13 @@ fn DifferentScopes() -> i32 { if (true) { returned var v: i32 = 0; if (true) { - // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+6]]:20: error: cannot declare a `returned var` in the scope of another `returned var` [ReturnedVarShadowed] + // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+7]]:20: error: cannot declare a `returned var` in the scope of another `returned var` [ReturnedVarShadowed] // CHECK:STDERR: returned var w: i32 = 1; // CHECK:STDERR: ^ // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-5]]:18: note: `returned var` was declared here [ReturnedVarHere] // CHECK:STDERR: returned var v: i32 = 0; // CHECK:STDERR: ^ + // CHECK:STDERR: returned var w: i32 = 1; } } @@ -158,25 +159,25 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %w.var: ref %i32 = var w // CHECK:STDOUT: %w: ref %i32 = bind_name w, %w.var // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8] -// CHECK:STDOUT: %impl.elem0.loc36: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc36: = bound_method %int_1, %impl.elem0.loc36 [template = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %Convert.specific_fn.loc36: = specific_function %Convert.bound.loc36, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] -// CHECK:STDOUT: %int.convert_checked.loc36: init %i32 = call %Convert.specific_fn.loc36(%int_1) [template = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc36: init %i32 = converted %int_1, %int.convert_checked.loc36 [template = constants.%int_1.5d2] -// CHECK:STDOUT: assign %w.var, %.loc36 +// CHECK:STDOUT: %impl.elem0.loc37: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc37: = bound_method %int_1, %impl.elem0.loc37 [template = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %Convert.specific_fn.loc37: = specific_function %Convert.bound.loc37, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c] +// CHECK:STDOUT: %int.convert_checked.loc37: init %i32 = call %Convert.specific_fn.loc37(%int_1) [template = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc37: init %i32 = converted %int_1, %int.convert_checked.loc37 [template = constants.%int_1.5d2] +// CHECK:STDOUT: assign %w.var, %.loc37 // CHECK:STDOUT: br !if.else.loc29 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc29: // CHECK:STDOUT: br !if.else.loc27 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc27: -// CHECK:STDOUT: %int_0.loc39: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc39: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] -// CHECK:STDOUT: %Convert.bound.loc39: = bound_method %int_0.loc39, %impl.elem0.loc39 [template = constants.%Convert.bound.d04] -// CHECK:STDOUT: %Convert.specific_fn.loc39: = specific_function %Convert.bound.loc39, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] -// CHECK:STDOUT: %int.convert_checked.loc39: init %i32 = call %Convert.specific_fn.loc39(%int_0.loc39) [template = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc39_11.1: %i32 = value_of_initializer %int.convert_checked.loc39 [template = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc39_11.2: %i32 = converted %int_0.loc39, %.loc39_11.1 [template = constants.%int_0.6a9] -// CHECK:STDOUT: return %.loc39_11.2 +// CHECK:STDOUT: %int_0.loc40: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6] +// CHECK:STDOUT: %impl.elem0.loc40: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] +// CHECK:STDOUT: %Convert.bound.loc40: = bound_method %int_0.loc40, %impl.elem0.loc40 [template = constants.%Convert.bound.d04] +// CHECK:STDOUT: %Convert.specific_fn.loc40: = specific_function %Convert.bound.loc40, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62] +// CHECK:STDOUT: %int.convert_checked.loc40: init %i32 = call %Convert.specific_fn.loc40(%int_0.loc40) [template = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc40_11.1: %i32 = value_of_initializer %int.convert_checked.loc40 [template = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc40_11.2: %i32 = converted %int_0.loc40, %.loc40_11.1 [template = constants.%int_0.6a9] +// CHECK:STDOUT: return %.loc40_11.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index 112c2f5d91ad..4a3009e4d049 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -9,12 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_returned_var_type.carbon fn Mismatch() -> i32 { - // CHECK:STDERR: fail_returned_var_type.carbon:[[@LINE+6]]:19: error: type `f64` of `returned var` does not match return type of enclosing function [ReturnedVarWrongType] + // CHECK:STDERR: fail_returned_var_type.carbon:[[@LINE+7]]:19: error: type `f64` of `returned var` does not match return type of enclosing function [ReturnedVarWrongType] // CHECK:STDERR: returned var v: f64 = 0.0; // CHECK:STDERR: ^~~ // CHECK:STDERR: fail_returned_var_type.carbon:[[@LINE-4]]:15: note: return type of function is `i32` [ReturnTypeHereNote] // CHECK:STDERR: fn Mismatch() -> i32 { // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: returned var v: f64 = 0.0; return var; } diff --git a/toolchain/check/testdata/return/fail_type_mismatch.carbon b/toolchain/check/testdata/return/fail_type_mismatch.carbon index f72638dde0cc..161c7bc6ab92 100644 --- a/toolchain/check/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/return/fail_type_mismatch.carbon @@ -9,12 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_type_mismatch.carbon fn Main() -> i32 { - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: return 1.0; // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:3: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] // CHECK:STDERR: return 1.0; // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: return 1.0; } @@ -57,7 +58,7 @@ fn Main() -> i32 { // CHECK:STDOUT: fn @Main() -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %float: f64 = float_literal 1 [template = constants.%float] -// CHECK:STDOUT: %.loc18: %i32 = converted %float, [template = ] +// CHECK:STDOUT: %.loc19: %i32 = converted %float, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_value_disallowed.carbon b/toolchain/check/testdata/return/fail_value_disallowed.carbon index 08682bc655f9..b1ea9dd1b445 100644 --- a/toolchain/check/testdata/return/fail_value_disallowed.carbon +++ b/toolchain/check/testdata/return/fail_value_disallowed.carbon @@ -9,12 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_value_disallowed.carbon fn Main() { - // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE+6]]:3: error: no return expression should be provided in this context [ReturnStatementDisallowExpr] + // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE+7]]:3: error: no return expression should be provided in this context [ReturnStatementDisallowExpr] // CHECK:STDERR: return 0; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE-4]]:1: note: there was no return type provided [ReturnTypeOmittedNote] // CHECK:STDERR: fn Main() { // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: return 0; } diff --git a/toolchain/check/testdata/return/fail_value_missing.carbon b/toolchain/check/testdata/return/fail_value_missing.carbon index 01b963d087a3..0622aa8eeb12 100644 --- a/toolchain/check/testdata/return/fail_value_missing.carbon +++ b/toolchain/check/testdata/return/fail_value_missing.carbon @@ -9,12 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_value_missing.carbon fn Main() -> i32 { - // CHECK:STDERR: fail_value_missing.carbon:[[@LINE+6]]:3: error: missing return value [ReturnStatementMissingExpr] + // CHECK:STDERR: fail_value_missing.carbon:[[@LINE+7]]:3: error: missing return value [ReturnStatementMissingExpr] // CHECK:STDERR: return; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_value_missing.carbon:[[@LINE-4]]:11: note: return type of function is `i32` [ReturnTypeHereNote] // CHECK:STDERR: fn Main() -> i32 { // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: return; } diff --git a/toolchain/check/testdata/return/fail_var_in_type.carbon b/toolchain/check/testdata/return/fail_var_in_type.carbon index 7a547a33e792..5a60461f324a 100644 --- a/toolchain/check/testdata/return/fail_var_in_type.carbon +++ b/toolchain/check/testdata/return/fail_var_in_type.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_var_in_type.carbon var x: type = i32; -// CHECK:STDERR: fail_var_in_type.carbon:[[@LINE+3]]:13: error: cannot evaluate type expression [TypeExprEvaluationFailure] +// CHECK:STDERR: fail_var_in_type.carbon:[[@LINE+4]]:13: error: cannot evaluate type expression [TypeExprEvaluationFailure] // CHECK:STDERR: fn Six() -> x { return 6; } // CHECK:STDERR: ^ +// CHECK:STDERR: fn Six() -> x { return 6; } // CHECK:STDOUT: --- fail_var_in_type.carbon @@ -46,7 +47,7 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: %return.param_patt: = out_param_pattern %return.patt, runtime_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %x.ref: ref type = name_ref x, file.%x -// CHECK:STDOUT: %.loc15: type = bind_value %x.ref +// CHECK:STDOUT: %.loc16: type = bind_value %x.ref // CHECK:STDOUT: %return.param: ref = out_param runtime_param0 // CHECK:STDOUT: %return: ref = return_slot %return.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_access_into_invalid.carbon b/toolchain/check/testdata/struct/fail_access_into_invalid.carbon index 47327304a954..5c55d73466b0 100644 --- a/toolchain/check/testdata/struct/fail_access_into_invalid.carbon +++ b/toolchain/check/testdata/struct/fail_access_into_invalid.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_access_into_invalid.carbon -// CHECK:STDERR: fail_access_into_invalid.carbon:[[@LINE+3]]:10: error: name `a` not found [NameNotFound] +// CHECK:STDERR: fail_access_into_invalid.carbon:[[@LINE+4]]:10: error: name `a` not found [NameNotFound] // CHECK:STDERR: fn F() { a.b; } // CHECK:STDERR: ^ +// CHECK:STDERR: fn F() { a.b; } // CHECK:STDOUT: --- fail_access_into_invalid.carbon diff --git a/toolchain/check/testdata/struct/fail_assign_empty.carbon b/toolchain/check/testdata/struct/fail_assign_empty.carbon index ec1b9e887e1e..4a83370f8cb9 100644 --- a/toolchain/check/testdata/struct/fail_assign_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_empty.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_assign_empty.carbon -// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:20: error: cannot initialize struct with 1 field from struct with 0 fields [StructInitElementCountMismatch] +// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+4]]:20: error: cannot initialize struct with 1 field from struct with 0 fields [StructInitElementCountMismatch] // CHECK:STDERR: var x: {.a: i32} = {}; // CHECK:STDERR: ^~ +// CHECK:STDERR: var x: {.a: i32} = {}; // CHECK:STDOUT: --- fail_assign_empty.carbon @@ -42,7 +43,7 @@ var x: {.a: i32} = {}; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc15: %empty_struct_type = struct_literal () // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon index 29fe517c24e1..4b491cf4d529 100644 --- a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_assign_to_empty.carbon -// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:13: error: cannot initialize struct with 0 fields from struct with 1 field [StructInitElementCountMismatch] +// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+4]]:13: error: cannot initialize struct with 0 fields from struct with 1 field [StructInitElementCountMismatch] // CHECK:STDERR: var x: {} = {.a = 1}; // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: var x: {} = {.a = 1}; // CHECK:STDOUT: --- fail_assign_to_empty.carbon @@ -41,7 +42,7 @@ var x: {} = {.a = 1}; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %.loc14: %struct_type.a = struct_literal (%int_1) +// CHECK:STDOUT: %.loc15: %struct_type.a = struct_literal (%int_1) // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_duplicate_name.carbon b/toolchain/check/testdata/struct/fail_duplicate_name.carbon index 3393053f07ca..c787d3c079ec 100644 --- a/toolchain/check/testdata/struct/fail_duplicate_name.carbon +++ b/toolchain/check/testdata/struct/fail_duplicate_name.carbon @@ -44,12 +44,13 @@ let w: i32 = {.def = 1, .def = 2}.def; // CHECK:STDERR: var x: {.a: i32} = {.a = 1, .a = 2}; -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+6]]:39: error: duplicated field name `b` in struct literal [StructNameDuplicate] +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:39: error: duplicated field name `b` in struct literal [StructNameDuplicate] // CHECK:STDERR: var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+3]]:31: note: field with the same name here [StructNamePrevious] +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:31: note: field with the same name here [StructNamePrevious] // CHECK:STDERR: var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDERR: ^ +// CHECK:STDERR: var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: --- fail_duplicate_name.carbon diff --git a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon index bca33b93b9ef..347280bc28e2 100644 --- a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon @@ -14,9 +14,10 @@ // CHECK:STDERR: var x: {.a: i32} = {.b = 1}; -// CHECK:STDERR: fail_field_name_mismatch.carbon:[[@LINE+3]]:20: error: cannot convert from struct type `{.a: i32}` to `{.b: i32}`: missing field `b` in source type [StructInitMissingFieldInConversion] +// CHECK:STDERR: fail_field_name_mismatch.carbon:[[@LINE+4]]:20: error: cannot convert from struct type `{.a: i32}` to `{.b: i32}`: missing field `b` in source type [StructInitMissingFieldInConversion] // CHECK:STDERR: var y: {.b: i32} = x; // CHECK:STDERR: ^ +// CHECK:STDERR: var y: {.b: i32} = x; // CHECK:STDOUT: --- fail_field_name_mismatch.carbon diff --git a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon index e076a323a04f..e2996840d84e 100644 --- a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_field_type_mismatch.carbon -// CHECK:STDERR: fail_field_type_mismatch.carbon:[[@LINE+3]]:20: error: missing value for field `a` in struct initialization [StructInitMissingFieldInLiteral] +// CHECK:STDERR: fail_field_type_mismatch.carbon:[[@LINE+4]]:20: error: missing value for field `a` in struct initialization [StructInitMissingFieldInLiteral] // CHECK:STDERR: var x: {.a: i32} = {.b = 1.0}; // CHECK:STDERR: ^~~~~~~~~~ +// CHECK:STDERR: var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: --- fail_field_type_mismatch.carbon @@ -44,7 +45,7 @@ var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %float: f64 = float_literal 1 [template = constants.%float] -// CHECK:STDOUT: %.loc14: %struct_type.b = struct_literal (%float) +// CHECK:STDOUT: %.loc15: %struct_type.b = struct_literal (%float) // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_keyword_name.carbon b/toolchain/check/testdata/struct/fail_keyword_name.carbon index 6958dfc372db..c2f155a60e97 100644 --- a/toolchain/check/testdata/struct/fail_keyword_name.carbon +++ b/toolchain/check/testdata/struct/fail_keyword_name.carbon @@ -18,9 +18,10 @@ // CHECK:STDERR: fn F() -> {.class: i32}; -// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+3]]:19: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] +// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+4]]:19: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] // CHECK:STDERR: fn G() { return {.return = 5}; }; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: fn G() { return {.return = 5}; }; // CHECK:STDOUT: --- fail_keyword_name.carbon diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index d6f70cf2281c..eb898d4fda92 100644 --- a/toolchain/check/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/check/testdata/struct/fail_member_access_type.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_member_access_type.carbon var x: {.a: f64} = {.a = 4.0}; -// CHECK:STDERR: fail_member_access_type.carbon:[[@LINE+3]]:14: error: type `{.a: f64}` does not have a member `b` [QualifiedExprNameNotFound] +// CHECK:STDERR: fail_member_access_type.carbon:[[@LINE+4]]:14: error: type `{.a: f64}` does not have a member `b` [QualifiedExprNameNotFound] // CHECK:STDERR: var y: i32 = x.b; // CHECK:STDERR: ^~~ +// CHECK:STDERR: var y: i32 = x.b; // CHECK:STDOUT: --- fail_member_access_type.carbon diff --git a/toolchain/check/testdata/struct/fail_member_of_function.carbon b/toolchain/check/testdata/struct/fail_member_of_function.carbon index c8198ca2a0af..e0bab470caec 100644 --- a/toolchain/check/testdata/struct/fail_member_of_function.carbon +++ b/toolchain/check/testdata/struct/fail_member_of_function.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_member_of_function.carbon fn A() { - // CHECK:STDERR: fail_member_of_function.carbon:[[@LINE+3]]:3: error: expression cannot be used as a value [UseOfNonExprAsValue] + // CHECK:STDERR: fail_member_of_function.carbon:[[@LINE+4]]:3: error: expression cannot be used as a value [UseOfNonExprAsValue] // CHECK:STDERR: A.y; // CHECK:STDERR: ^ + // CHECK:STDERR: A.y; } diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index 98803488b2a2..7039e62834f6 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_non_member_access.carbon var x: {.a: i32} = {.a = 4}; -// CHECK:STDERR: fail_non_member_access.carbon:[[@LINE+3]]:14: error: type `{.a: i32}` does not have a member `b` [QualifiedExprNameNotFound] +// CHECK:STDERR: fail_non_member_access.carbon:[[@LINE+4]]:14: error: type `{.a: i32}` does not have a member `b` [QualifiedExprNameNotFound] // CHECK:STDERR: var y: i32 = x.b; // CHECK:STDERR: ^~~ +// CHECK:STDERR: var y: i32 = x.b; // CHECK:STDOUT: --- fail_non_member_access.carbon diff --git a/toolchain/check/testdata/struct/fail_too_few_values.carbon b/toolchain/check/testdata/struct/fail_too_few_values.carbon index ed8f41d156c6..8f59050a7b6c 100644 --- a/toolchain/check/testdata/struct/fail_too_few_values.carbon +++ b/toolchain/check/testdata/struct/fail_too_few_values.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_too_few_values.carbon -// CHECK:STDERR: fail_too_few_values.carbon:[[@LINE+3]]:29: error: cannot initialize struct with 2 fields from struct with 1 field [StructInitElementCountMismatch] +// CHECK:STDERR: fail_too_few_values.carbon:[[@LINE+4]]:29: error: cannot initialize struct with 2 fields from struct with 1 field [StructInitElementCountMismatch] // CHECK:STDERR: var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: --- fail_too_few_values.carbon @@ -44,7 +45,7 @@ var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] -// CHECK:STDOUT: %.loc14: %struct_type.a = struct_literal (%int_1) +// CHECK:STDOUT: %.loc15: %struct_type.a = struct_literal (%int_1) // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index 8e24511caaac..16e36bd80d12 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -8,12 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_type_assign.carbon -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `type` to `{.a: i32}` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `type` to `{.a: i32}` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: {.a: i32} = {.a: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:1: note: type `type` does not implement interface `Core.ImplicitAs({.a: i32})` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+4]]:1: note: type `type` does not implement interface `Core.ImplicitAs({.a: i32})` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: {.a: i32} = {.a: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: --- fail_type_assign.carbon @@ -48,7 +49,7 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a] -// CHECK:STDOUT: %.loc17: %struct_type.a = converted %struct_type.a, [template = ] +// CHECK:STDOUT: %.loc18: %struct_type.a = converted %struct_type.a, [template = ] // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_value_as_type.carbon b/toolchain/check/testdata/struct/fail_value_as_type.carbon index 9b0f2925ae5c..9ba9401227b4 100644 --- a/toolchain/check/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/check/testdata/struct/fail_value_as_type.carbon @@ -8,12 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_value_as_type.carbon -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+6]]:8: error: cannot implicitly convert from `{.a: Core.IntLiteral}` to `type` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+7]]:8: error: cannot implicitly convert from `{.a: Core.IntLiteral}` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: {.a = 1}; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: note: type `{.a: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+4]]:8: note: type `{.a: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: {.a = 1}; // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: var x: {.a = 1}; // CHECK:STDOUT: --- fail_value_as_type.carbon diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index ee4518ba5e5b..4b19471a261d 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -43,12 +43,13 @@ var c_bad: C({.c = 1, .d = 2}) = F(); // --- fail_bad_value.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C({.a = 1, .b = 2})` to `C({.a = 3, .b = 4})` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `C({.a = 1, .b = 2})` to `C({.a = 3, .b = 4})` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C({.a = 1, .b = 2})` does not implement interface `Core.ImplicitAs(C({.a = 3, .b = 4}))` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+4]]:1: note: type `C({.a = 1, .b = 2})` does not implement interface `Core.ImplicitAs(C({.a = 3, .b = 4}))` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: --- implicit.carbon @@ -510,9 +511,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.b37 [template = constants.%F] -// CHECK:STDOUT: %.loc9_36: ref %C.a8a = temporary_storage -// CHECK:STDOUT: %F.call: init %C.a8a = call %F.ref() to %.loc9_36 -// CHECK:STDOUT: %.loc9_37: %C.5a7 = converted %F.call, [template = ] +// CHECK:STDOUT: %.loc10_36: ref %C.a8a = temporary_storage +// CHECK:STDOUT: %F.call: init %C.a8a = call %F.ref() to %.loc10_36 +// CHECK:STDOUT: %.loc10_37: %C.5a7 = converted %F.call, [template = ] // CHECK:STDOUT: assign file.%c_bad.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon b/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon index f024eae8ea6d..efc8b760d131 100644 --- a/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon +++ b/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon -// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+3]]:19: error: missing value for field `a` in struct initialization [StructInitMissingFieldInLiteral] +// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+4]]:19: error: missing value for field `a` in struct initialization [StructInitMissingFieldInLiteral] // CHECK:STDERR: var x: {.a: {}} = {.b = {}}; // CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: var x: {.a: {}} = {.b = {}}; // CHECK:STDOUT: --- fail_assign_nested.carbon @@ -31,8 +32,8 @@ var x: {.a: {}} = {.b = {}}; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14_26: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc14_27: %struct_type.b = struct_literal (%.loc14_26) +// CHECK:STDOUT: %.loc15_26: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc15_27: %struct_type.b = struct_literal (%.loc15_26) // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon b/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon index 8306852ac7b0..8d83956e94f3 100644 --- a/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon @@ -10,12 +10,13 @@ class Incomplete; -// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+6]]:8: error: variable has incomplete type `{.a: Incomplete}` [IncompleteTypeInVarDecl] +// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+7]]:8: error: variable has incomplete type `{.a: Incomplete}` [IncompleteTypeInVarDecl] // CHECK:STDERR: var s: {.a: 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 s: {.a: Incomplete}; var p: Incomplete* = &s.a; diff --git a/toolchain/check/testdata/tuple/access/fail_access_error.carbon b/toolchain/check/testdata/tuple/access/fail_access_error.carbon index 67c76733c422..b9304b4323f9 100644 --- a/toolchain/check/testdata/tuple/access/fail_access_error.carbon +++ b/toolchain/check/testdata/tuple/access/fail_access_error.carbon @@ -9,9 +9,10 @@ // 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+3]]:17: error: name `oops` not found [NameNotFound] +// 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 diff --git a/toolchain/check/testdata/tuple/access/fail_empty_access.carbon b/toolchain/check/testdata/tuple/access/fail_empty_access.carbon index 405bf44f58da..242eab98734f 100644 --- a/toolchain/check/testdata/tuple/access/fail_empty_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_empty_access.carbon @@ -11,9 +11,10 @@ fn F() {} fn Run() { - // CHECK:STDERR: fail_empty_access.carbon:[[@LINE+3]]:3: error: tuple element index `0` is past the end of type `()` [TupleIndexOutOfBounds] + // 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; } @@ -56,8 +57,8 @@ fn Run() { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref() // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0] -// CHECK:STDOUT: %.loc17_5.1: ref %empty_tuple.type = temporary_storage -// CHECK:STDOUT: %.loc17_5.2: ref %empty_tuple.type = temporary %.loc17_5.1, %F.call +// 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: diff --git a/toolchain/check/testdata/tuple/access/fail_large_index.carbon b/toolchain/check/testdata/tuple/access/fail_large_index.carbon index b1ba74b54d58..2094a9815c45 100644 --- a/toolchain/check/testdata/tuple/access/fail_large_index.carbon +++ b/toolchain/check/testdata/tuple/access/fail_large_index.carbon @@ -15,9 +15,10 @@ var b: (i32,) = a; // CHECK:STDERR: ^~~ // CHECK:STDERR: var c: i32 = b.1; -// CHECK:STDERR: fail_large_index.carbon:[[@LINE+3]]:14: error: tuple element index `2147483647` is past the end of type `(i32,)` [TupleIndexOutOfBounds] +// 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 @@ -89,7 +90,7 @@ var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDOUT: %b.ref.loc17: ref %tuple.type.a1c = name_ref b, file.%b // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: assign file.%c.var, -// CHECK:STDOUT: %b.ref.loc21: ref %tuple.type.a1c = name_ref b, file.%b +// CHECK:STDOUT: %b.ref.loc22: ref %tuple.type.a1c = name_ref b, file.%b // CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647] // CHECK:STDOUT: assign file.%d.var, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon index 0dfb78ae9048..4602f740fbf8 100644 --- a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon @@ -9,9 +9,10 @@ // 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+3]]:14: error: tuple element index `-10` is past the end of type `(i32, i32)` [TupleIndexOutOfBounds] +// 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 @@ -90,11 +91,11 @@ var b: i32 = a.(-10); // CHECK:STDOUT: assign file.%a.var, %.loc11_28 // CHECK:STDOUT: %a.ref: ref %tuple.type.d07 = name_ref a, file.%a // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10] -// CHECK:STDOUT: %impl.elem0.loc15: %Op.type.e42 = impl_witness_access constants.%impl_witness.0f6, element0 [template = constants.%Op.bba] -// CHECK:STDOUT: %Op.bound: = bound_method %int_10, %impl.elem0.loc15 [template = constants.%Op.bound] +// CHECK:STDOUT: %impl.elem0.loc16: %Op.type.e42 = impl_witness_access constants.%impl_witness.0f6, element0 [template = constants.%Op.bba] +// CHECK:STDOUT: %Op.bound: = bound_method %int_10, %impl.elem0.loc16 [template = constants.%Op.bound] // CHECK:STDOUT: %int.snegate: init Core.IntLiteral = call %Op.bound(%int_10) [template = constants.%int_-10] -// CHECK:STDOUT: %.loc15_17.1: Core.IntLiteral = value_of_initializer %int.snegate [template = constants.%int_-10] -// CHECK:STDOUT: %.loc15_17.2: Core.IntLiteral = converted %int.snegate, %.loc15_17.1 [template = constants.%int_-10] +// CHECK:STDOUT: %.loc16_17.1: Core.IntLiteral = value_of_initializer %int.snegate [template = constants.%int_-10] +// CHECK:STDOUT: %.loc16_17.2: Core.IntLiteral = converted %int.snegate, %.loc16_17.1 [template = constants.%int_-10] // CHECK:STDOUT: assign file.%b.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon index 1b779e1f3e3d..d2f83ba3e960 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon @@ -10,9 +10,10 @@ var a: (i32, i32) = (2, 3); var b: i32 = 0; -// CHECK:STDERR: fail_non_deterministic_type.carbon:[[@LINE+3]]:14: error: tuple index must be a constant [TupleIndexNotConstant] +// 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 diff --git a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon index ba5ef9d4d05d..68f006fa0f29 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -9,12 +9,13 @@ // 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+6]]:17: error: cannot implicitly convert from `f64` to `Core.IntLiteral` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+7]]:17: error: cannot implicitly convert from `f64` to `Core.IntLiteral` [ImplicitAsConversionFailure] // CHECK:STDERR: var b: i32 = a.(2.6); // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+3]]:17: note: type `f64` does not implement interface `Core.ImplicitAs(Core.IntLiteral)` [MissingImplInMemberAccessNote] +// 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 @@ -86,7 +87,7 @@ var b: i32 = a.(2.6); // CHECK:STDOUT: assign file.%a.var, %.loc11_28 // CHECK:STDOUT: %a.ref: ref %tuple.type.d07 = name_ref a, file.%a // CHECK:STDOUT: %float: f64 = float_literal 2.6000000000000001 [template = constants.%float] -// CHECK:STDOUT: %.loc18: Core.IntLiteral = converted %float, [template = ] +// CHECK:STDOUT: %.loc19: Core.IntLiteral = converted %float, [template = ] // CHECK:STDOUT: assign file.%b.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon index dd2c745bd6fd..00c47afafe27 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon @@ -16,9 +16,10 @@ fn Main() { 0[1]; var non_tuple: [i32; 2] = (5, 5); - // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+3]]:20: error: type `[i32; 2]` does not support tuple indexing; only tuples can be indexed that way [TupleIndexOnANonTupleType] + // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+4]]:20: error: type `[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; } @@ -95,7 +96,7 @@ fn Main() { // CHECK:STDOUT: %first.var: ref %i32 = var first // CHECK:STDOUT: %first: ref %i32 = bind_name first, %first.var // CHECK:STDOUT: %non_tuple.ref: ref %array_type = name_ref non_tuple, %non_tuple -// CHECK:STDOUT: %int_0.loc22: Core.IntLiteral = int_value 0 [template = constants.%int_0] +// CHECK:STDOUT: %int_0.loc23: Core.IntLiteral = int_value 0 [template = constants.%int_0] // CHECK:STDOUT: assign %first.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon index 5f6b9fe953a7..b5e43a9ce202 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon @@ -9,9 +9,10 @@ // 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+3]]:14: error: tuple element index `2` is past the end of type `(i32, i32)` [TupleIndexOutOfBounds] +// 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 diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon index 83c040c878a1..c5080197ca23 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon @@ -9,9 +9,10 @@ // 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+3]]:14: error: tuple element index `2` is past the end of type `(i32, i32)` [TupleIndexOutOfBounds] +// 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 @@ -85,10 +86,10 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: assign file.%a.var, %.loc11_29 // CHECK:STDOUT: %a.ref: ref %tuple.type.d07 = name_ref a, file.%a // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] -// CHECK:STDOUT: %.loc15_28.1: %struct_type.index = struct_literal (%int_2) +// CHECK:STDOUT: %.loc16_28.1: %struct_type.index = struct_literal (%int_2) // CHECK:STDOUT: %struct: %struct_type.index = struct_value (%int_2) [template = constants.%struct] -// CHECK:STDOUT: %.loc15_28.2: %struct_type.index = converted %.loc15_28.1, %struct [template = constants.%struct] -// CHECK:STDOUT: %.loc15_29: Core.IntLiteral = struct_access %.loc15_28.2, element0 [template = constants.%int_2] +// CHECK:STDOUT: %.loc16_28.2: %struct_type.index = converted %.loc16_28.1, %struct [template = constants.%struct] +// CHECK:STDOUT: %.loc16_29: Core.IntLiteral = struct_access %.loc16_28.2, element0 [template = constants.%int_2] // CHECK:STDOUT: assign file.%b.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/fail_assign_nested.carbon b/toolchain/check/testdata/tuple/fail_assign_nested.carbon index 6ed017c0d30c..d67a5fe9c44d 100644 --- a/toolchain/check/testdata/tuple/fail_assign_nested.carbon +++ b/toolchain/check/testdata/tuple/fail_assign_nested.carbon @@ -8,9 +8,10 @@ // 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+3]]:36: error: cannot initialize tuple of 2 elements from tuple with 3 elements [TupleInitElementCountMismatch] +// 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 @@ -53,12 +54,12 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3] -// CHECK:STDOUT: %.loc14_44: %tuple.type.37f = tuple_literal (%int_1, %int_2, %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 [template = constants.%int_4] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6] -// CHECK:STDOUT: %.loc14_55: %tuple.type.37f = tuple_literal (%int_4, %int_5, %int_6) -// CHECK:STDOUT: %.loc14_56: %tuple.type.e89 = tuple_literal (%.loc14_44, %.loc14_55) +// 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, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index fc0d41e4f000..8a1a829e6d6a 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -8,12 +8,13 @@ // 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+6]]:21: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+7]]:21: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: (i32, i32) = (2, 65.89); // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+3]]:21: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] +// 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 @@ -57,15 +58,15 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc] // CHECK:STDOUT: %float: f64 = float_literal 65.890000000000001 [template = constants.%float] -// CHECK:STDOUT: %.loc17_30.1: %tuple.type.2c1 = tuple_literal (%int_2, %float) +// CHECK:STDOUT: %.loc18_30.1: %tuple.type.2c1 = tuple_literal (%int_2, %float) // CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956] // CHECK:STDOUT: %Convert.bound: = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound] // CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] // CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_2) [template = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc17_30.2: init %i32 = converted %int_2, %int.convert_checked [template = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc18_30.2: init %i32 = converted %int_2, %int.convert_checked [template = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access file.%x.var, element0 -// CHECK:STDOUT: %.loc17_30.3: init %i32 = initialize_from %.loc17_30.2 to %tuple.elem0 [template = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc17_30.4: %i32 = converted %float, [template = ] +// CHECK:STDOUT: %.loc18_30.3: init %i32 = initialize_from %.loc18_30.2 to %tuple.elem0 [template = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc18_30.4: %i32 = converted %float, [template = ] // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon index aa2a2d71fb27..ceeef727464d 100644 --- a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon @@ -10,12 +10,13 @@ class Incomplete; -// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+6]]:8: error: variable has incomplete type `(i32, Incomplete)` [IncompleteTypeInVarDecl] +// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+7]]:8: error: variable has incomplete type `(i32, Incomplete)` [IncompleteTypeInVarDecl] // 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]; diff --git a/toolchain/check/testdata/tuple/fail_too_few_element.carbon b/toolchain/check/testdata/tuple/fail_too_few_element.carbon index 57d68ea09902..9fcd7e324a8f 100644 --- a/toolchain/check/testdata/tuple/fail_too_few_element.carbon +++ b/toolchain/check/testdata/tuple/fail_too_few_element.carbon @@ -8,9 +8,10 @@ // 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+3]]:21: error: cannot initialize tuple of 2 elements from tuple with 1 element [TupleInitElementCountMismatch] +// 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 @@ -44,7 +45,7 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2] -// CHECK:STDOUT: %.loc14: %tuple.type.985 = tuple_literal (%int_2) +// CHECK:STDOUT: %.loc15: %tuple.type.985 = tuple_literal (%int_2) // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/fail_type_assign.carbon b/toolchain/check/testdata/tuple/fail_type_assign.carbon index e6702bb1d973..150f07860f01 100644 --- a/toolchain/check/testdata/tuple/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuple/fail_type_assign.carbon @@ -8,12 +8,13 @@ // 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+6]]:18: error: cannot implicitly convert from `type` to `i32` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+7]]:18: error: cannot implicitly convert from `type` to `i32` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: (i32, ) = (i32, ); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:18: note: type `type` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote] +// 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 @@ -48,8 +49,8 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %.loc17_24.1: %tuple.type.85c = tuple_literal (%i32) -// CHECK:STDOUT: %.loc17_24.2: %i32 = converted %i32, [template = ] +// CHECK:STDOUT: %.loc18_24.1: %tuple.type.85c = tuple_literal (%i32) +// CHECK:STDOUT: %.loc18_24.2: %i32 = converted %i32, [template = ] // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/fail_value_as_type.carbon b/toolchain/check/testdata/tuple/fail_value_as_type.carbon index 3b231e5d88f4..760d5ac75b7c 100644 --- a/toolchain/check/testdata/tuple/fail_value_as_type.carbon +++ b/toolchain/check/testdata/tuple/fail_value_as_type.carbon @@ -8,12 +8,13 @@ // 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+6]]:8: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+7]]:8: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: (1, ); // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] +// 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 diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index 1b7c1e20c901..5063de368ca5 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -45,12 +45,13 @@ var c_bad: C((1, 2, 3)) = F(); impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C((1, 2))` to `C((3, 4))` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `C((1, 2))` to `C((3, 4))` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C((1, 2))` does not implement interface `Core.ImplicitAs(C((3, 4)))` [MissingImplInMemberAccessNote] +// 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 @@ -535,9 +536,9 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.b37 [template = constants.%F] -// CHECK:STDOUT: %.loc10_26: ref %C.cf0 = temporary_storage -// CHECK:STDOUT: %F.call: init %C.cf0 = call %F.ref() to %.loc10_26 -// CHECK:STDOUT: %.loc10_27: %C.ed5 = converted %F.call, [template = ] +// 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_27: %C.ed5 = converted %F.call, [template = ] // CHECK:STDOUT: assign file.%c_bad.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon b/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon index df8abdb34dd2..81e5d3429562 100644 --- a/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon +++ b/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon @@ -8,9 +8,10 @@ // 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+3]]:16: error: cannot initialize tuple of 1 element from tuple with 0 elements [TupleInitElementCountMismatch] +// 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 @@ -30,7 +31,7 @@ var x: ((),) = (); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc15: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: assign file.%x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon b/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon index 434a52a04221..8ccf40a6bfdb 100644 --- a/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon +++ b/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon @@ -8,9 +8,10 @@ // 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+3]]:13: error: cannot initialize tuple of 0 elements from tuple with 1 element [TupleInitElementCountMismatch] +// 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 @@ -30,8 +31,8 @@ var x: () = ((),); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14_15: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc14_17: %tuple.type = tuple_literal (%.loc14_15) +// 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, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/fail_not_copyable.carbon b/toolchain/check/testdata/var/fail_not_copyable.carbon index 723f4aee0ebd..fcf2f5039ea4 100644 --- a/toolchain/check/testdata/var/fail_not_copyable.carbon +++ b/toolchain/check/testdata/var/fail_not_copyable.carbon @@ -21,9 +21,10 @@ fn F(x: X) { var s: String = "hello"; // TODO: Decide on rules for when classes are copyable. - // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+3]]:14: error: cannot copy value of type `X` [CopyOfUncopyableType] + // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+4]]:14: error: cannot copy value of type `X` [CopyOfUncopyableType] // CHECK:STDERR: var y: X = x; // CHECK:STDERR: ^ + // CHECK:STDERR: var y: X = x; } diff --git a/toolchain/check/testdata/var/fail_storage_is_literal.carbon b/toolchain/check/testdata/var/fail_storage_is_literal.carbon index eb8135674134..b4e70ceac6e8 100644 --- a/toolchain/check/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/check/testdata/var/fail_storage_is_literal.carbon @@ -9,12 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_storage_is_literal.carbon fn Main() { - // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+6]]:10: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+7]]:10: error: cannot implicitly convert from `Core.IntLiteral` to `type` [ImplicitAsConversionFailure] // CHECK:STDERR: var x: 1 = 1; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+3]]:10: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+4]]:10: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: 1 = 1; // CHECK:STDERR: ^ + // CHECK:STDERR: var x: 1 = 1; } diff --git a/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon b/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon index 1ff104e55f72..d877a962765b 100644 --- a/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon +++ b/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon @@ -58,17 +58,18 @@ var x2: () = if false then () else (); // CHECK:STDERR: var y: bool = true or false; -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+11]]:16: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+12]]:16: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var y2: bool = false or true; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+7]]:16: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:16: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var y2: bool = false or true; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+3]]:16: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:16: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo] // CHECK:STDERR: var y2: bool = false or true; // CHECK:STDERR: ^~~~~~~~~~~~~ +// CHECK:STDERR: var y2: bool = false or true; // CHECK:STDOUT: --- fail_todo_control_flow_init.carbon diff --git a/toolchain/check/testdata/var/no_prelude/export_name.carbon b/toolchain/check/testdata/var/no_prelude/export_name.carbon index e1bb7077ea99..a07b8eab4e4a 100644 --- a/toolchain/check/testdata/var/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/var/no_prelude/export_name.carbon @@ -34,11 +34,12 @@ export v; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_use_export.carbon:[[@LINE+5]]:1: in import [InImport] +// CHECK:STDERR: fail_todo_use_export.carbon:[[@LINE+6]]:1: in import [InImport] // CHECK:STDERR: export.carbon:4:1: in import [InImport] // CHECK:STDERR: base.carbon:4:5: error: semantics TODO: `Non-constant ImportRefLoaded (comes up with var)` [SemanticsTodo] // CHECK:STDERR: var v: (); // CHECK:STDERR: ^ +// CHECK:STDERR: import library "export"; var w: () = v; @@ -99,9 +100,9 @@ var w: () = v; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %v.ref: ref %empty_tuple.type = name_ref v, imports.%import_ref [template = ] -// CHECK:STDOUT: %.loc11_13: init %empty_tuple.type = tuple_init () to file.%w.var [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc11_14: init %empty_tuple.type = converted %v.ref, %.loc11_13 [template = constants.%empty_tuple] -// CHECK:STDOUT: assign file.%w.var, %.loc11_14 +// CHECK:STDOUT: %.loc12_13: init %empty_tuple.type = tuple_init () to file.%w.var [template = constants.%empty_tuple] +// CHECK:STDOUT: %.loc12_14: init %empty_tuple.type = converted %v.ref, %.loc12_13 [template = constants.%empty_tuple] +// CHECK:STDOUT: assign file.%w.var, %.loc12_14 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon b/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon index 416fbecd9a25..a826201b77f5 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon @@ -11,12 +11,13 @@ fn Main() { var x: () = (); - // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: error: duplicate name being declared in the same scope [NameDeclDuplicate] + // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+7]]:7: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: var x: () = (); // CHECK:STDERR: ^ // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: var x: () = (); // CHECK:STDERR: ^ + // CHECK:STDERR: var x: () = (); } @@ -44,12 +45,12 @@ fn Main() { // CHECK:STDOUT: %.loc13_16.2: init %empty_tuple.type = tuple_init () to %x.var.loc13 [template = constants.%empty_tuple] // CHECK:STDOUT: %.loc13_17: init %empty_tuple.type = converted %.loc13_16.1, %.loc13_16.2 [template = constants.%empty_tuple] // CHECK:STDOUT: assign %x.var.loc13, %.loc13_17 -// CHECK:STDOUT: %x.var.loc20: ref %empty_tuple.type = var x -// CHECK:STDOUT: %x.loc20: ref %empty_tuple.type = bind_name x, %x.var.loc20 -// CHECK:STDOUT: %.loc20_16.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc20_16.2: init %empty_tuple.type = tuple_init () to %x.var.loc20 [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc20_17: init %empty_tuple.type = converted %.loc20_16.1, %.loc20_16.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: assign %x.var.loc20, %.loc20_17 +// CHECK:STDOUT: %x.var.loc21: ref %empty_tuple.type = var x +// CHECK:STDOUT: %x.loc21: ref %empty_tuple.type = bind_name x, %x.var.loc21 +// CHECK:STDOUT: %.loc21_16.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc21_16.2: init %empty_tuple.type = tuple_init () to %x.var.loc21 [template = constants.%empty_tuple] +// CHECK:STDOUT: %.loc21_17: init %empty_tuple.type = converted %.loc21_16.1, %.loc21_16.2 [template = constants.%empty_tuple] +// CHECK:STDOUT: assign %x.var.loc21, %.loc21_17 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/no_prelude/fail_generic.carbon b/toolchain/check/testdata/var/no_prelude/fail_generic.carbon index 89f7994de283..74a1b60d09ef 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_generic.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_generic.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_generic.carbon fn Main() { - // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:11: error: `var` declaration cannot declare a compile-time binding [CompileTimeBindingInVarDecl] + // CHECK:STDERR: fail_generic.carbon:[[@LINE+4]]:11: error: `var` declaration cannot declare a compile-time binding [CompileTimeBindingInVarDecl] // CHECK:STDERR: var x:! () = (); // CHECK:STDERR: ^~ + // CHECK:STDERR: var x:! () = (); } @@ -36,10 +37,10 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x // CHECK:STDOUT: %x: %empty_tuple.type = bind_symbolic_name x, %x.var [symbolic = constants.%x] -// CHECK:STDOUT: %.loc15_17.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_17.2: init %empty_tuple.type = tuple_init () to %x.var [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc15_18: init %empty_tuple.type = converted %.loc15_17.1, %.loc15_17.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: assign %x.var, %.loc15_18 +// CHECK:STDOUT: %.loc16_17.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc16_17.2: init %empty_tuple.type = tuple_init () to %x.var [template = constants.%empty_tuple] +// CHECK:STDOUT: %.loc16_18: init %empty_tuple.type = converted %.loc16_17.1, %.loc16_17.2 [template = constants.%empty_tuple] +// CHECK:STDOUT: assign %x.var, %.loc16_18 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon b/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon index 1c3b26c90a02..6006cc924cf2 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon fn Main() { - // CHECK:STDERR: fail_init_type_mismatch.carbon:[[@LINE+3]]:3: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound] + // CHECK:STDERR: fail_init_type_mismatch.carbon:[[@LINE+4]]:3: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound] // CHECK:STDERR: var x: {} = (); // CHECK:STDERR: ^~~~~~~~~~~~~~~ + // CHECK:STDERR: var x: {} = (); } @@ -36,10 +37,10 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.var: ref %empty_struct_type = var x // CHECK:STDOUT: %x: ref %empty_struct_type = bind_name x, %x.var -// CHECK:STDOUT: %.loc15_16.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc16_16.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc15_16.2: %empty_tuple.type = converted %.loc15_16.1, %empty_tuple [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc15_17: %empty_struct_type = converted %.loc15_16.1, [template = ] +// CHECK:STDOUT: %.loc16_16.2: %empty_tuple.type = converted %.loc16_16.1, %empty_tuple [template = constants.%empty_tuple] +// CHECK:STDOUT: %.loc16_17: %empty_struct_type = converted %.loc16_16.1, [template = ] // CHECK:STDOUT: assign %x.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon b/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon index 72c4c49de971..dfb4c6864539 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon fn Main() { - // CHECK:STDERR: fail_init_with_self.carbon:[[@LINE+3]]:15: error: name `x` not found [NameNotFound] + // CHECK:STDERR: fail_init_with_self.carbon:[[@LINE+4]]:15: error: name `x` not found [NameNotFound] // CHECK:STDERR: var x: () = x; // CHECK:STDERR: ^ + // CHECK:STDERR: var x: () = x; } diff --git a/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon b/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon index e1ddf6f028a9..50ddc7155cdc 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon @@ -12,9 +12,10 @@ fn Main() { var x: (); } -// CHECK:STDERR: fail_lookup_outside_scope.carbon:[[@LINE+3]]:13: error: name `x` not found [NameNotFound] +// CHECK:STDERR: fail_lookup_outside_scope.carbon:[[@LINE+4]]:13: error: name `x` not found [NameNotFound] // CHECK:STDERR: var y: () = x; // CHECK:STDERR: ^ +// CHECK:STDERR: var y: () = x; // CHECK:STDOUT: --- fail_lookup_outside_scope.carbon diff --git a/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon index 510e6b0b7c7f..ff306ff4896f 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon @@ -36,9 +36,10 @@ private protected var c: (); // CHECK:STDERR: protected protected var d: (); -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `abstract` not allowed on `var` declaration [ModifierNotAllowedOnDeclaration] +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `abstract` not allowed on `var` declaration [ModifierNotAllowedOnDeclaration] // CHECK:STDERR: abstract var e: (); // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: abstract var e: (); // CHECK:STDOUT: --- fail_modifiers.carbon diff --git a/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon b/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon index 9c790d7c2d59..5bd94df11e66 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon @@ -19,12 +19,13 @@ namespace A; // CHECK:STDERR: var A: (); -// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE+6]]:5: error: duplicate name being declared in the same scope [NameDeclDuplicate] +// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE+7]]:5: error: duplicate name being declared in the same scope [NameDeclDuplicate] // CHECK:STDERR: var A: () = (); // CHECK:STDERR: ^ // CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-14]]:1: note: name is previously declared here [NameDeclPrevious] // CHECK:STDERR: namespace A; // CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: var A: () = (); // CHECK:STDOUT: --- fail_namespace_conflict.carbon @@ -41,16 +42,16 @@ var A: () = (); // CHECK:STDOUT: %A.loc11: = namespace [template] {} // CHECK:STDOUT: %A.var.loc20: ref %empty_tuple.type = var A // CHECK:STDOUT: %A.loc20: ref %empty_tuple.type = bind_name A, %A.var.loc20 -// CHECK:STDOUT: %A.var.loc28: ref %empty_tuple.type = var A -// CHECK:STDOUT: %A.loc28: ref %empty_tuple.type = bind_name A, %A.var.loc28 +// CHECK:STDOUT: %A.var.loc29: ref %empty_tuple.type = var A +// CHECK:STDOUT: %A.loc29: ref %empty_tuple.type = bind_name A, %A.var.loc29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc28_14.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc28_14.2: init %empty_tuple.type = tuple_init () to file.%A.var.loc28 [template = constants.%empty_tuple] -// CHECK:STDOUT: %.loc28_15: init %empty_tuple.type = converted %.loc28_14.1, %.loc28_14.2 [template = constants.%empty_tuple] -// CHECK:STDOUT: assign file.%A.var.loc28, %.loc28_15 +// CHECK:STDOUT: %.loc29_14.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc29_14.2: init %empty_tuple.type = tuple_init () to file.%A.var.loc29 [template = constants.%empty_tuple] +// CHECK:STDOUT: %.loc29_15: init %empty_tuple.type = converted %.loc29_14.1, %.loc29_14.2 [template = constants.%empty_tuple] +// CHECK:STDOUT: assign file.%A.var.loc29, %.loc29_15 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/no_prelude/import_access.carbon b/toolchain/check/testdata/var/no_prelude/import_access.carbon index e8aa4dc69cdc..b7edd98572d1 100644 --- a/toolchain/check/testdata/var/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/var/no_prelude/import_access.carbon @@ -46,9 +46,10 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:14: error: member name `v` not found in `Test` [MemberNameNotFoundInScope] +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:14: error: member name `v` not found in `Test` [MemberNameNotFoundInScope] // CHECK:STDERR: var v2: () = Test.v; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: var v2: () = Test.v; // CHECK:STDOUT: --- def.carbon diff --git a/toolchain/check/testdata/where_expr/constraints.carbon b/toolchain/check/testdata/where_expr/constraints.carbon index b311cce26d2a..a35a48c0bf0c 100644 --- a/toolchain/check/testdata/where_expr/constraints.carbon +++ b/toolchain/check/testdata/where_expr/constraints.carbon @@ -104,15 +104,16 @@ fn EmptyStruct(Y:! J where .Self == {}); // TODO: Should report that `C` does not meeet the constraint. fn NotEmptyStruct() { - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `type` to `J where...` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+10]]:3: error: cannot implicitly convert from `type` to `J where...` [ImplicitAsConversionFailure] // CHECK:STDERR: EmptyStruct(C); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+6]]:3: note: type `type` does not implement interface `Core.ImplicitAs(J where...)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+7]]:3: note: type `type` does not implement interface `Core.ImplicitAs(J where...)` [MissingImplInMemberAccessNote] // CHECK:STDERR: EmptyStruct(C); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE-10]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] // CHECK:STDERR: fn EmptyStruct(Y:! J where .Self == {}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: EmptyStruct(C); } @@ -679,7 +680,7 @@ fn NotEmptyStruct() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %EmptyStruct.ref: %EmptyStruct.type = name_ref EmptyStruct, file.%EmptyStruct.decl [template = constants.%EmptyStruct] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc39: %J_where.type = converted %C.ref, [template = ] +// CHECK:STDOUT: %.loc40: %J_where.type = converted %C.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/where_expr/designator.carbon b/toolchain/check/testdata/where_expr/designator.carbon index dd2759e1a3e1..1b99b314f490 100644 --- a/toolchain/check/testdata/where_expr/designator.carbon +++ b/toolchain/check/testdata/where_expr/designator.carbon @@ -80,9 +80,10 @@ class C { library "[[@TEST_NAME]]"; class D { - // CHECK:STDERR: fail_dot_self_method_return_type.carbon:[[@LINE+3]]:13: error: name `.Self` not found [NameNotFound] + // CHECK:STDERR: fail_dot_self_method_return_type.carbon:[[@LINE+4]]:13: error: name `.Self` not found [NameNotFound] // CHECK:STDERR: fn G() -> .Self { return Self; } // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: fn G() -> .Self { return Self; } } diff --git a/toolchain/check/testdata/where_expr/equal_rewrite.carbon b/toolchain/check/testdata/where_expr/equal_rewrite.carbon index 60dd85d1c283..83d3e26d3ced 100644 --- a/toolchain/check/testdata/where_expr/equal_rewrite.carbon +++ b/toolchain/check/testdata/where_expr/equal_rewrite.carbon @@ -210,12 +210,13 @@ let H: (E where .F = bool and .G = ()) = f64; // CHECK:STDERR: let J: ((E where .F = {}) where .G = i32) = bool; -// CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `type` to `E where .(E.F) = .(E.G)` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `type` to `E where .(E.F) = .(E.G)` [ImplicitAsConversionFailure] // CHECK:STDERR: let K: (E where .F = .Self.G) = bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+3]]:1: note: type `type` does not implement interface `Core.ImplicitAs(E where .(E.F) = .(E.G))` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_type_does_not_implement_where.carbon:[[@LINE+4]]:1: note: type `type` does not implement interface `Core.ImplicitAs(E where .(E.F) = .(E.G))` [MissingImplInMemberAccessNote] // CHECK:STDERR: let K: (E where .F = .Self.G) = bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: --- equal_constraint.carbon @@ -1381,8 +1382,8 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %bool.make_type.loc27: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc27: %E_where.type.bef = converted %bool.make_type.loc27, [template = ] // CHECK:STDOUT: %J: %E_where.type.bef = bind_name J, -// CHECK:STDOUT: %bool.make_type.loc35: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc35: %E_where.type.503 = converted %bool.make_type.loc35, [template = ] +// CHECK:STDOUT: %bool.make_type.loc36: init type = call constants.%Bool() [template = bool] +// CHECK:STDOUT: %.loc36: %E_where.type.503 = converted %bool.make_type.loc36, [template = ] // CHECK:STDOUT: %K: %E_where.type.503 = bind_name K, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/where_expr/fail_not_facet.carbon b/toolchain/check/testdata/where_expr/fail_not_facet.carbon index 5aba4094ff11..7352eda2e23c 100644 --- a/toolchain/check/testdata/where_expr/fail_not_facet.carbon +++ b/toolchain/check/testdata/where_expr/fail_not_facet.carbon @@ -32,9 +32,10 @@ fn G(U:! NOT_DECLARED where .Self == bool); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_var.carbon:[[@LINE+3]]:8: error: name `e` not found [NameNotFound] +// CHECK:STDERR: fail_var.carbon:[[@LINE+4]]:8: error: name `e` not found [NameNotFound] // CHECK:STDERR: var v: e where .x = 3; // CHECK:STDERR: ^ +// CHECK:STDERR: var v: e where .x = 3; // CHECK:STDOUT: --- fail_left_where_not_facet.carbon diff --git a/toolchain/check/testdata/while/fail_bad_condition.carbon b/toolchain/check/testdata/while/fail_bad_condition.carbon index f76c9cd5621d..9c3d80cbf424 100644 --- a/toolchain/check/testdata/while/fail_bad_condition.carbon +++ b/toolchain/check/testdata/while/fail_bad_condition.carbon @@ -9,12 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/while/fail_bad_condition.carbon fn While() { - // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `String` to `bool` [ImplicitAsConversionFailure] + // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+7]]:9: error: cannot implicitly convert from `String` to `bool` [ImplicitAsConversionFailure] // CHECK:STDERR: while ("Hello") {} // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+3]]:9: note: type `String` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessNote] + // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+4]]:9: note: type `String` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessNote] // CHECK:STDERR: while ("Hello") {} // CHECK:STDERR: ^~~~~~~~~ + // CHECK:STDERR: while ("Hello") {} } @@ -49,7 +50,7 @@ fn While() { // CHECK:STDOUT: // CHECK:STDOUT: !while.cond: // CHECK:STDOUT: %str: String = string_literal "Hello" [template = constants.%str] -// CHECK:STDOUT: %.loc18: bool = converted %str, [template = ] +// CHECK:STDOUT: %.loc19: bool = converted %str, [template = ] // CHECK:STDOUT: if br !while.body else br !while.done // CHECK:STDOUT: // CHECK:STDOUT: !while.body: diff --git a/toolchain/check/testdata/while/fail_break_continue.carbon b/toolchain/check/testdata/while/fail_break_continue.carbon index afc6b6f36f2b..dbc4891c90e2 100644 --- a/toolchain/check/testdata/while/fail_break_continue.carbon +++ b/toolchain/check/testdata/while/fail_break_continue.carbon @@ -28,9 +28,10 @@ fn While() { // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: continue; - // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+3]]:3: error: `break` can only be used in a loop [BreakOutsideLoop] + // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error: `break` can only be used in a loop [BreakOutsideLoop] // CHECK:STDERR: break; // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: break; } diff --git a/toolchain/codegen/testdata/fail_target_triple.carbon b/toolchain/codegen/testdata/fail_target_triple.carbon index dcceae7684a4..8a24666c74b4 100644 --- a/toolchain/codegen/testdata/fail_target_triple.carbon +++ b/toolchain/codegen/testdata/fail_target_triple.carbon @@ -10,5 +10,6 @@ // bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/codegen/testdata/fail_target_triple.carbon // NOAUTOUPDATE // CHECK:STDERR: error: invalid target: {{.*}}x86_687{{.*}} +// CHECK:STDERR: fn Main() {} diff --git a/toolchain/diagnostics/testdata/fail_multiline_token.carbon b/toolchain/diagnostics/testdata/fail_multiline_token.carbon index 75ae95b0983f..2c759d421b91 100644 --- a/toolchain/diagnostics/testdata/fail_multiline_token.carbon +++ b/toolchain/diagnostics/testdata/fail_multiline_token.carbon @@ -10,9 +10,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/diagnostics/testdata/fail_multiline_token.carbon -// CHECK:STDERR: fail_multiline_token.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer +// CHECK:STDERR: fail_multiline_token.carbon:[[@LINE+4]]:1: error: unrecognized declaration introducer // CHECK:STDERR: ''' // CHECK:STDERR: ^~~ +// CHECK:STDERR: ''' hello ''' diff --git a/toolchain/driver/testdata/fail_errors_in_two_files.carbon b/toolchain/driver/testdata/fail_errors_in_two_files.carbon index 7b4f0ad14f4a..a23d52cd18f9 100644 --- a/toolchain/driver/testdata/fail_errors_in_two_files.carbon +++ b/toolchain/driver/testdata/fail_errors_in_two_files.carbon @@ -21,7 +21,8 @@ fn run(String program) { // --- fail_file2.carbon -// CHECK:STDERR: fail_file2.carbon:[[@LINE+3]]:10: error: invalid digit 'a' in decimal numeric literal +// CHECK:STDERR: fail_file2.carbon:[[@LINE+4]]:10: error: invalid digit 'a' in decimal numeric literal // CHECK:STDERR: var x = 3a; // CHECK:STDERR: ^ +// CHECK:STDERR: var x = 3a; diff --git a/toolchain/driver/testdata/fail_errors_sorted.carbon b/toolchain/driver/testdata/fail_errors_sorted.carbon index 4b5da0d0efde..a4514661806a 100644 --- a/toolchain/driver/testdata/fail_errors_sorted.carbon +++ b/toolchain/driver/testdata/fail_errors_sorted.carbon @@ -17,7 +17,8 @@ fn run(String program) { return True; -// CHECK:STDERR: fail_errors_sorted.carbon:[[@LINE+3]]:10: error: invalid digit 'a' in decimal numeric literal +// CHECK:STDERR: fail_errors_sorted.carbon:[[@LINE+4]]:10: error: invalid digit 'a' in decimal numeric literal // CHECK:STDERR: var x = 3a; // CHECK:STDERR: ^ +// CHECK:STDERR: var x = 3a; diff --git a/toolchain/driver/testdata/fail_errors_streamed.carbon b/toolchain/driver/testdata/fail_errors_streamed.carbon index 0a842c256d43..789edd7a2f7f 100644 --- a/toolchain/driver/testdata/fail_errors_streamed.carbon +++ b/toolchain/driver/testdata/fail_errors_streamed.carbon @@ -13,11 +13,12 @@ fn run(String program) { return True; -// CHECK:STDERR: fail_errors_streamed.carbon:[[@LINE+7]]:10: error: invalid digit 'a' in decimal numeric literal +// CHECK:STDERR: fail_errors_streamed.carbon:[[@LINE+8]]:10: error: invalid digit 'a' in decimal numeric literal // CHECK:STDERR: var x = 3a; // CHECK:STDERR: ^ // CHECK:STDERR: // CHECK:STDERR: fail_errors_streamed.carbon:[[@LINE-7]]:24: error: opening symbol without a corresponding closing symbol // CHECK:STDERR: fn run(String program) { // CHECK:STDERR: ^ +// CHECK:STDERR: var x = 3a; diff --git a/toolchain/driver/testdata/fail_flag.carbon b/toolchain/driver/testdata/fail_flag.carbon index 75e0a07d33ea..7fb726990647 100644 --- a/toolchain/driver/testdata/fail_flag.carbon +++ b/toolchain/driver/testdata/fail_flag.carbon @@ -10,3 +10,4 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/fail_flag.carbon // CHECK:STDERR: error: unknown option `--non-existent-flag` +// CHECK:STDERR: diff --git a/toolchain/driver/testdata/fail_flush_errors.carbon b/toolchain/driver/testdata/fail_flush_errors.carbon index df34d16feb9e..3f9ad2ff65da 100644 --- a/toolchain/driver/testdata/fail_flush_errors.carbon +++ b/toolchain/driver/testdata/fail_flush_errors.carbon @@ -31,8 +31,9 @@ fn F() { // Add the name into the string table via a declaration rather than an expression. if (true) { var undeclared3: () = (); } - // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+3]]:3: error: name `undeclared3` not found + // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+4]]:3: error: name `undeclared3` not found // CHECK:STDERR: undeclared3; // CHECK:STDERR: ^~~~~~~~~~~ + // CHECK:STDERR: undeclared3; } diff --git a/toolchain/driver/testdata/fail_input_is_directory.carbon b/toolchain/driver/testdata/fail_input_is_directory.carbon index 725e27bd5f4a..2b9411de59db 100644 --- a/toolchain/driver/testdata/fail_input_is_directory.carbon +++ b/toolchain/driver/testdata/fail_input_is_directory.carbon @@ -10,3 +10,4 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/fail_input_is_directory.carbon // CHECK:STDERR: .: error: error opening file for read: Invalid argument +// CHECK:STDERR: diff --git a/toolchain/driver/testdata/fail_missing_file.carbon b/toolchain/driver/testdata/fail_missing_file.carbon index 4dcb817a6fb3..64891b558ee2 100644 --- a/toolchain/driver/testdata/fail_missing_file.carbon +++ b/toolchain/driver/testdata/fail_missing_file.carbon @@ -10,3 +10,4 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/fail_missing_file.carbon // CHECK:STDERR: not_file.carbon: error: error opening file for read: No such file or directory [ErrorOpeningFile] +// CHECK:STDERR: diff --git a/toolchain/driver/testdata/fail_missing_stdin_output.carbon b/toolchain/driver/testdata/fail_missing_stdin_output.carbon index a29d3c0e362b..0be0fcdeb2e4 100644 --- a/toolchain/driver/testdata/fail_missing_stdin_output.carbon +++ b/toolchain/driver/testdata/fail_missing_stdin_output.carbon @@ -10,3 +10,4 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/fail_missing_stdin_output.carbon // CHECK:STDERR: error: output file name must be specified for input `-` that is not a regular file +// CHECK:STDERR: diff --git a/toolchain/format/testdata/basics/fail_invalid_comment.carbon b/toolchain/format/testdata/basics/fail_invalid_comment.carbon index eecb8e2b10e4..3e38551e778f 100644 --- a/toolchain/format/testdata/basics/fail_invalid_comment.carbon +++ b/toolchain/format/testdata/basics/fail_invalid_comment.carbon @@ -17,6 +17,7 @@ // CHECK:STDERR: fail_test.carbon:2:3: error: whitespace is required after '//' // CHECK:STDERR: //f // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: // CHECK:STDOUT: //f // CHECK:STDOUT: diff --git a/toolchain/format/testdata/basics/fail_nonexistent.carbon b/toolchain/format/testdata/basics/fail_nonexistent.carbon index 0285786412eb..cc274933d14b 100644 --- a/toolchain/format/testdata/basics/fail_nonexistent.carbon +++ b/toolchain/format/testdata/basics/fail_nonexistent.carbon @@ -9,3 +9,4 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/format/testdata/basics/fail_nonexistent.carbon // CHECK:STDERR: fail_target_file.carbon: error: error opening file for read: No such file or directory +// CHECK:STDERR: diff --git a/toolchain/lex/testdata/fail_bad_comment_introducers.carbon b/toolchain/lex/testdata/fail_bad_comment_introducers.carbon index d08be7075680..a714af73646d 100644 --- a/toolchain/lex/testdata/fail_bad_comment_introducers.carbon +++ b/toolchain/lex/testdata/fail_bad_comment_introducers.carbon @@ -45,9 +45,10 @@ // As we have specialized code to scan short indented comment blocks, make sure // the behavior is preserved even for (absurdly) large indents. - // CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+3]]:83: error: whitespace is required after '//' [NoWhitespaceAfterCommentIntroducer] + // CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:83: error: whitespace is required after '//' [NoWhitespaceAfterCommentIntroducer] // CHECK:STDERR: //very indented block // CHECK:STDERR: ^ + // CHECK:STDERR: //very indented block //very indented block //very indented block diff --git a/toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon b/toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon index bc472077fad1..2204bdf177ca 100644 --- a/toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon +++ b/toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon @@ -34,6 +34,7 @@ // CHECK:STDERR: fail_bad_comment_introducers_mid_block_indent_change.carbon:[[@LINE-19]]:3: error: whitespace is required after '//' [NoWhitespaceAfterCommentIntroducer] // CHECK:STDERR: //abc // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_bad_comment_introducers_mid_block_indent_change.carbon // CHECK:STDOUT: tokens: diff --git a/toolchain/lex/testdata/fail_bad_raw_identifier.carbon b/toolchain/lex/testdata/fail_bad_raw_identifier.carbon index 3e2ee2a25e58..f7d9bf7d433b 100644 --- a/toolchain/lex/testdata/fail_bad_raw_identifier.carbon +++ b/toolchain/lex/testdata/fail_bad_raw_identifier.carbon @@ -91,9 +91,10 @@ r#"hello"# // CHECK:STDOUT: tokens: // Ensure that we correctly handle a `#` as the first token in the file. -// CHECK:STDERR: fail_hash_at_start_of_file.carbon:[[@LINE+3]]:1: error: encountered unrecognized characters while parsing [UnrecognizedCharacters] +// CHECK:STDERR: fail_hash_at_start_of_file.carbon:[[@LINE+4]]:1: error: encountered unrecognized characters while parsing [UnrecognizedCharacters] // CHECK:STDERR: #foo // CHECK:STDERR: ^ +// CHECK:STDERR: #foo // CHECK:STDOUT: - { index: 1, kind: 'Error', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: '#', has_leading_space: true } // CHECK:STDOUT: - { index: 2, kind: 'Identifier', line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: 'foo', identifier: 0 } diff --git a/toolchain/lex/testdata/fail_block_string_second_line.carbon b/toolchain/lex/testdata/fail_block_string_second_line.carbon index 9b4178dad474..9b4769dc8359 100644 --- a/toolchain/lex/testdata/fail_block_string_second_line.carbon +++ b/toolchain/lex/testdata/fail_block_string_second_line.carbon @@ -16,12 +16,13 @@ var s: String = ''' // CHECK:STDERR: fail_block_string_second_line.carbon:[[@LINE-10]]:3: error: only whitespace is permitted before the closing `'''` of a multi-line string [ContentBeforeStringTerminator] // CHECK:STDERR: error here: ''' // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_block_string_second_line.carbon // CHECK:STDOUT: tokens: -// CHECK:STDOUT: - { index: 1, kind: 'Var', line: {{ *}}[[@LINE-16]], column: 1, indent: 1, spelling: 'var', has_leading_space: true } -// CHECK:STDOUT: - { index: 2, kind: 'Identifier', line: {{ *}}[[@LINE-17]], column: 5, indent: 1, spelling: 's', identifier: 0, has_leading_space: true } -// CHECK:STDOUT: - { index: 3, kind: 'Colon', line: {{ *}}[[@LINE-18]], column: 6, indent: 1, spelling: ':' } -// CHECK:STDOUT: - { index: 4, kind: 'StringTypeLiteral', line: {{ *}}[[@LINE-19]], column: 8, indent: 1, spelling: 'String', has_leading_space: true } -// CHECK:STDOUT: - { index: 5, kind: 'Equal', line: {{ *}}[[@LINE-20]], column: 15, indent: 1, spelling: '=', has_leading_space: true } -// CHECK:STDOUT: - { index: 6, kind: 'StringLiteral', line: {{ *}}[[@LINE-21]], column: 17, indent: 1, spelling: '''' +// CHECK:STDOUT: - { index: 1, kind: 'Var', line: {{ *}}[[@LINE-17]], column: 1, indent: 1, spelling: 'var', has_leading_space: true } +// CHECK:STDOUT: - { index: 2, kind: 'Identifier', line: {{ *}}[[@LINE-18]], column: 5, indent: 1, spelling: 's', identifier: 0, has_leading_space: true } +// CHECK:STDOUT: - { index: 3, kind: 'Colon', line: {{ *}}[[@LINE-19]], column: 6, indent: 1, spelling: ':' } +// CHECK:STDOUT: - { index: 4, kind: 'StringTypeLiteral', line: {{ *}}[[@LINE-20]], column: 8, indent: 1, spelling: 'String', has_leading_space: true } +// CHECK:STDOUT: - { index: 5, kind: 'Equal', line: {{ *}}[[@LINE-21]], column: 15, indent: 1, spelling: '=', has_leading_space: true } +// CHECK:STDOUT: - { index: 6, kind: 'StringLiteral', line: {{ *}}[[@LINE-22]], column: 17, indent: 1, spelling: '''' // CHECK:STDOUT: error here: '''', value: `error here: `, has_leading_space: true } diff --git a/toolchain/lex/testdata/fail_mismatched_brackets.carbon b/toolchain/lex/testdata/fail_mismatched_brackets.carbon index f2ab84db8113..5c18af52a42f 100644 --- a/toolchain/lex/testdata/fail_mismatched_brackets.carbon +++ b/toolchain/lex/testdata/fail_mismatched_brackets.carbon @@ -26,8 +26,9 @@ // CHECK:STDOUT: - { index: 3, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 3, indent: 1, spelling: '}', has_leading_space: true } // CHECK:STDOUT: - { index: 4, kind: 'CloseParen', line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: ')', opening_token: 2, has_leading_space: true } -// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+3]]:1: error: opening symbol without a corresponding closing symbol [UnmatchedOpening] +// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+4]]:1: error: opening symbol without a corresponding closing symbol [UnmatchedOpening] // CHECK:STDERR: [ // CHECK:STDERR: ^ +// CHECK:STDERR: [ // CHECK:STDOUT: - { index: 5, kind: 'Error', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: '[', has_leading_space: true } diff --git a/toolchain/lex/testdata/fail_mismatched_brackets_2.carbon b/toolchain/lex/testdata/fail_mismatched_brackets_2.carbon index af574bdaab9a..96de56381e72 100644 --- a/toolchain/lex/testdata/fail_mismatched_brackets_2.carbon +++ b/toolchain/lex/testdata/fail_mismatched_brackets_2.carbon @@ -21,18 +21,19 @@ fn F() { // CHECK:STDERR: fail_mismatched_brackets_2.carbon:[[@LINE-9]]:1: error: closing symbol without a corresponding opening symbol [UnmatchedClosing] // CHECK:STDERR: } // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_mismatched_brackets_2.carbon // CHECK:STDOUT: tokens: -// CHECK:STDOUT: - { index: 1, kind: 'Fn', line: {{ *}}[[@LINE-18]], column: 1, indent: 1, spelling: 'fn', has_leading_space: true } -// CHECK:STDOUT: - { index: 2, kind: 'Identifier', line: {{ *}}[[@LINE-19]], column: 4, indent: 1, spelling: 'F', identifier: 0, has_leading_space: true } -// CHECK:STDOUT: - { index: 3, kind: 'OpenParen', line: {{ *}}[[@LINE-20]], column: 5, indent: 1, spelling: '(', closing_token: 4 } -// CHECK:STDOUT: - { index: 4, kind: 'CloseParen', line: {{ *}}[[@LINE-21]], column: 6, indent: 1, spelling: ')', opening_token: 3 } -// CHECK:STDOUT: - { index: 5, kind: 'OpenCurlyBrace', line: {{ *}}[[@LINE-22]], column: 8, indent: 1, spelling: '{', closing_token: 12, has_leading_space: true } -// CHECK:STDOUT: - { index: 6, kind: 'If', line: {{ *}}[[@LINE-22]], column: 3, indent: 3, spelling: 'if', has_leading_space: true } -// CHECK:STDOUT: - { index: 7, kind: 'OpenParen', line: {{ *}}[[@LINE-23]], column: 6, indent: 3, spelling: '(', closing_token: 9, has_leading_space: true } -// CHECK:STDOUT: - { index: 8, kind: 'Identifier', line: {{ *}}[[@LINE-24]], column: 7, indent: 3, spelling: 'thing1', identifier: 1 } -// CHECK:STDOUT: - { index: 9, kind: 'CloseParen', line: {{ *}}[[@LINE-25]], column: 13, indent: 3, spelling: ')', opening_token: 7 } -// CHECK:STDOUT: - { index: 10, kind: 'Identifier', line: {{ *}}[[@LINE-25]], column: 5, indent: 5, spelling: 'thing2', identifier: 2, has_leading_space: true } -// CHECK:STDOUT: - { index: 11, kind: 'Semi', line: {{ *}}[[@LINE-26]], column: 11, indent: 5, spelling: ';' } -// CHECK:STDOUT: - { index: 12, kind: 'CloseCurlyBrace', line: {{ *}}[[@LINE-26]], column: 3, indent: 3, spelling: '}', opening_token: 5, has_leading_space: true } -// CHECK:STDOUT: - { index: 13, kind: 'Error', line: {{ *}}[[@LINE-26]], column: 1, indent: 1, spelling: '}', has_leading_space: true } +// CHECK:STDOUT: - { index: 1, kind: 'Fn', line: {{ *}}[[@LINE-19]], column: 1, indent: 1, spelling: 'fn', has_leading_space: true } +// CHECK:STDOUT: - { index: 2, kind: 'Identifier', line: {{ *}}[[@LINE-20]], column: 4, indent: 1, spelling: 'F', identifier: 0, has_leading_space: true } +// CHECK:STDOUT: - { index: 3, kind: 'OpenParen', line: {{ *}}[[@LINE-21]], column: 5, indent: 1, spelling: '(', closing_token: 4 } +// CHECK:STDOUT: - { index: 4, kind: 'CloseParen', line: {{ *}}[[@LINE-22]], column: 6, indent: 1, spelling: ')', opening_token: 3 } +// CHECK:STDOUT: - { index: 5, kind: 'OpenCurlyBrace', line: {{ *}}[[@LINE-23]], column: 8, indent: 1, spelling: '{', closing_token: 12, has_leading_space: true } +// CHECK:STDOUT: - { index: 6, kind: 'If', line: {{ *}}[[@LINE-23]], column: 3, indent: 3, spelling: 'if', has_leading_space: true } +// CHECK:STDOUT: - { index: 7, kind: 'OpenParen', line: {{ *}}[[@LINE-24]], column: 6, indent: 3, spelling: '(', closing_token: 9, has_leading_space: true } +// CHECK:STDOUT: - { index: 8, kind: 'Identifier', line: {{ *}}[[@LINE-25]], column: 7, indent: 3, spelling: 'thing1', identifier: 1 } +// CHECK:STDOUT: - { index: 9, kind: 'CloseParen', line: {{ *}}[[@LINE-26]], column: 13, indent: 3, spelling: ')', opening_token: 7 } +// CHECK:STDOUT: - { index: 10, kind: 'Identifier', line: {{ *}}[[@LINE-26]], column: 5, indent: 5, spelling: 'thing2', identifier: 2, has_leading_space: true } +// CHECK:STDOUT: - { index: 11, kind: 'Semi', line: {{ *}}[[@LINE-27]], column: 11, indent: 5, spelling: ';' } +// CHECK:STDOUT: - { index: 12, kind: 'CloseCurlyBrace', line: {{ *}}[[@LINE-27]], column: 3, indent: 3, spelling: '}', opening_token: 5, has_leading_space: true } +// CHECK:STDOUT: - { index: 13, kind: 'Error', line: {{ *}}[[@LINE-27]], column: 1, indent: 1, spelling: '}', has_leading_space: true } diff --git a/toolchain/lex/testdata/fail_multifile.carbon b/toolchain/lex/testdata/fail_multifile.carbon index 58b26f3719b9..f145d717c7f0 100644 --- a/toolchain/lex/testdata/fail_multifile.carbon +++ b/toolchain/lex/testdata/fail_multifile.carbon @@ -21,8 +21,9 @@ // --- fail_b.carbon // CHECK:STDOUT: - filename: fail_b.carbon // CHECK:STDOUT: tokens: -// CHECK:STDERR: fail_b.carbon:[[@LINE+3]]:3: error: empty digit sequence in numeric literal [EmptyDigitSequence] +// CHECK:STDERR: fail_b.carbon:[[@LINE+4]]:3: error: empty digit sequence in numeric literal [EmptyDigitSequence] // CHECK:STDERR: 2.b // CHECK:STDERR: ^ +// CHECK:STDERR: 2.b // CHECK:STDOUT: - { index: 1, kind: 'Error', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: '2.b', has_leading_space: true } diff --git a/toolchain/lex/testdata/fail_trailing_comments.carbon b/toolchain/lex/testdata/fail_trailing_comments.carbon index 2ca924cae03c..b879925b8e06 100644 --- a/toolchain/lex/testdata/fail_trailing_comments.carbon +++ b/toolchain/lex/testdata/fail_trailing_comments.carbon @@ -27,26 +27,27 @@ var c: i32 = 0.4; // still more trailing comment // CHECK:STDERR: fail_trailing_comments.carbon:[[@LINE-17]]:19: error: trailing comments are not permitted [TrailingComment] // CHECK:STDERR: var c: i32 = 0.4; // still more trailing comment // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_trailing_comments.carbon // CHECK:STDOUT: tokens: -// CHECK:STDOUT: - { index: 1, kind: 'Var', line: {{ *}}[[@LINE-24]], column: 1, indent: 1, spelling: 'var', has_leading_space: true } -// CHECK:STDOUT: - { index: 2, kind: 'Identifier', line: {{ *}}[[@LINE-25]], column: 5, indent: 1, spelling: 'a', identifier: 0, has_leading_space: true } -// CHECK:STDOUT: - { index: 3, kind: 'Colon', line: {{ *}}[[@LINE-26]], column: 6, indent: 1, spelling: ':' } -// CHECK:STDOUT: - { index: 4, kind: 'IntTypeLiteral', line: {{ *}}[[@LINE-27]], column: 8, indent: 1, spelling: 'i32', has_leading_space: true } -// CHECK:STDOUT: - { index: 5, kind: 'Equal', line: {{ *}}[[@LINE-28]], column: 12, indent: 1, spelling: '=', has_leading_space: true } -// CHECK:STDOUT: - { index: 6, kind: 'IntLiteral', line: {{ *}}[[@LINE-29]], column: 14, indent: 1, spelling: '1', value: `1`, has_leading_space: true } -// CHECK:STDOUT: - { index: 7, kind: 'Semi', line: {{ *}}[[@LINE-30]], column: 15, indent: 1, spelling: ';' } -// CHECK:STDOUT: - { index: 8, kind: 'Var', line: {{ *}}[[@LINE-30]], column: 1, indent: 1, spelling: 'var', has_leading_space: true } -// CHECK:STDOUT: - { index: 9, kind: 'Identifier', line: {{ *}}[[@LINE-31]], column: 5, indent: 1, spelling: 'b', identifier: 1, has_leading_space: true } -// CHECK:STDOUT: - { index: 10, kind: 'Colon', line: {{ *}}[[@LINE-32]], column: 6, indent: 1, spelling: ':' } -// CHECK:STDOUT: - { index: 11, kind: 'IntLiteral', line: {{ *}}[[@LINE-33]], column: 8, indent: 1, spelling: '32', value: `32`, has_leading_space: true } -// CHECK:STDOUT: - { index: 12, kind: 'Equal', line: {{ *}}[[@LINE-34]], column: 11, indent: 1, spelling: '=', has_leading_space: true } -// CHECK:STDOUT: - { index: 13, kind: 'IntLiteral', line: {{ *}}[[@LINE-35]], column: 13, indent: 1, spelling: '13', value: `13`, has_leading_space: true } -// CHECK:STDOUT: - { index: 14, kind: 'Semi', line: {{ *}}[[@LINE-36]], column: 15, indent: 1, spelling: ';' } -// CHECK:STDOUT: - { index: 15, kind: 'Var', line: {{ *}}[[@LINE-36]], column: 1, indent: 1, spelling: 'var', has_leading_space: true } -// CHECK:STDOUT: - { index: 16, kind: 'Identifier', line: {{ *}}[[@LINE-37]], column: 5, indent: 1, spelling: 'c', identifier: 2, has_leading_space: true } -// CHECK:STDOUT: - { index: 17, kind: 'Colon', line: {{ *}}[[@LINE-38]], column: 6, indent: 1, spelling: ':' } -// CHECK:STDOUT: - { index: 18, kind: 'IntTypeLiteral', line: {{ *}}[[@LINE-39]], column: 8, indent: 1, spelling: 'i32', has_leading_space: true } -// CHECK:STDOUT: - { index: 19, kind: 'Equal', line: {{ *}}[[@LINE-40]], column: 12, indent: 1, spelling: '=', has_leading_space: true } -// CHECK:STDOUT: - { index: 20, kind: 'RealLiteral', line: {{ *}}[[@LINE-41]], column: 14, indent: 1, spelling: '0.4', value: `4*10^-1`, has_leading_space: true } -// CHECK:STDOUT: - { index: 21, kind: 'Semi', line: {{ *}}[[@LINE-42]], column: 17, indent: 1, spelling: ';' } +// CHECK:STDOUT: - { index: 1, kind: 'Var', line: {{ *}}[[@LINE-25]], column: 1, indent: 1, spelling: 'var', has_leading_space: true } +// CHECK:STDOUT: - { index: 2, kind: 'Identifier', line: {{ *}}[[@LINE-26]], column: 5, indent: 1, spelling: 'a', identifier: 0, has_leading_space: true } +// CHECK:STDOUT: - { index: 3, kind: 'Colon', line: {{ *}}[[@LINE-27]], column: 6, indent: 1, spelling: ':' } +// CHECK:STDOUT: - { index: 4, kind: 'IntTypeLiteral', line: {{ *}}[[@LINE-28]], column: 8, indent: 1, spelling: 'i32', has_leading_space: true } +// CHECK:STDOUT: - { index: 5, kind: 'Equal', line: {{ *}}[[@LINE-29]], column: 12, indent: 1, spelling: '=', has_leading_space: true } +// CHECK:STDOUT: - { index: 6, kind: 'IntLiteral', line: {{ *}}[[@LINE-30]], column: 14, indent: 1, spelling: '1', value: `1`, has_leading_space: true } +// CHECK:STDOUT: - { index: 7, kind: 'Semi', line: {{ *}}[[@LINE-31]], column: 15, indent: 1, spelling: ';' } +// CHECK:STDOUT: - { index: 8, kind: 'Var', line: {{ *}}[[@LINE-31]], column: 1, indent: 1, spelling: 'var', has_leading_space: true } +// CHECK:STDOUT: - { index: 9, kind: 'Identifier', line: {{ *}}[[@LINE-32]], column: 5, indent: 1, spelling: 'b', identifier: 1, has_leading_space: true } +// CHECK:STDOUT: - { index: 10, kind: 'Colon', line: {{ *}}[[@LINE-33]], column: 6, indent: 1, spelling: ':' } +// CHECK:STDOUT: - { index: 11, kind: 'IntLiteral', line: {{ *}}[[@LINE-34]], column: 8, indent: 1, spelling: '32', value: `32`, has_leading_space: true } +// CHECK:STDOUT: - { index: 12, kind: 'Equal', line: {{ *}}[[@LINE-35]], column: 11, indent: 1, spelling: '=', has_leading_space: true } +// CHECK:STDOUT: - { index: 13, kind: 'IntLiteral', line: {{ *}}[[@LINE-36]], column: 13, indent: 1, spelling: '13', value: `13`, has_leading_space: true } +// CHECK:STDOUT: - { index: 14, kind: 'Semi', line: {{ *}}[[@LINE-37]], column: 15, indent: 1, spelling: ';' } +// CHECK:STDOUT: - { index: 15, kind: 'Var', line: {{ *}}[[@LINE-37]], column: 1, indent: 1, spelling: 'var', has_leading_space: true } +// CHECK:STDOUT: - { index: 16, kind: 'Identifier', line: {{ *}}[[@LINE-38]], column: 5, indent: 1, spelling: 'c', identifier: 2, has_leading_space: true } +// CHECK:STDOUT: - { index: 17, kind: 'Colon', line: {{ *}}[[@LINE-39]], column: 6, indent: 1, spelling: ':' } +// CHECK:STDOUT: - { index: 18, kind: 'IntTypeLiteral', line: {{ *}}[[@LINE-40]], column: 8, indent: 1, spelling: 'i32', has_leading_space: true } +// CHECK:STDOUT: - { index: 19, kind: 'Equal', line: {{ *}}[[@LINE-41]], column: 12, indent: 1, spelling: '=', has_leading_space: true } +// CHECK:STDOUT: - { index: 20, kind: 'RealLiteral', line: {{ *}}[[@LINE-42]], column: 14, indent: 1, spelling: '0.4', value: `4*10^-1`, has_leading_space: true } +// CHECK:STDOUT: - { index: 21, kind: 'Semi', line: {{ *}}[[@LINE-43]], column: 17, indent: 1, spelling: ';' } diff --git a/toolchain/lex/testdata/multiline_string_literals.carbon b/toolchain/lex/testdata/multiline_string_literals.carbon index 1c67d9fa098f..97760deb167e 100644 --- a/toolchain/lex/testdata/multiline_string_literals.carbon +++ b/toolchain/lex/testdata/multiline_string_literals.carbon @@ -32,6 +32,7 @@ a // CHECK:STDERR: fail_quotes.carbon:2:1: error: use `'''` delimiters for a multi-line string literal, not `"""` [MultiLineStringWithDoubleQuotes] // CHECK:STDERR: """ // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_indent_mismatch.carbon // CHECK:STDOUT: tokens: // CHECK:STDOUT: - { index: 1, kind: 'StringLiteral', line: {{ *}}2, column: 3, indent: 3, spelling: '''' diff --git a/toolchain/lex/testdata/numeric_literals.carbon b/toolchain/lex/testdata/numeric_literals.carbon index cd39bd13f238..46cdd759c5d3 100644 --- a/toolchain/lex/testdata/numeric_literals.carbon +++ b/toolchain/lex/testdata/numeric_literals.carbon @@ -137,8 +137,9 @@ fn F() { // CHECK:STDOUT: - filename: fail_unknown_base.carbon // CHECK:STDOUT: tokens: -// CHECK:STDERR: fail_unknown_base.carbon:[[@LINE+3]]:1: error: unknown base specifier in numeric literal [UnknownBaseSpecifier] +// CHECK:STDERR: fail_unknown_base.carbon:[[@LINE+4]]:1: error: unknown base specifier in numeric literal [UnknownBaseSpecifier] // CHECK:STDERR: 05 // CHECK:STDERR: ^ +// CHECK:STDERR: 05 // CHECK:STDOUT: - { index: 1, kind: 'Error', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: '05', has_leading_space: true } diff --git a/toolchain/lex/testdata/string_literals.carbon b/toolchain/lex/testdata/string_literals.carbon index b8d4b9c7c905..f5956f4f1af1 100644 Binary files a/toolchain/lex/testdata/string_literals.carbon and b/toolchain/lex/testdata/string_literals.carbon differ diff --git a/toolchain/lower/testdata/basics/fail_before_lowering.carbon b/toolchain/lower/testdata/basics/fail_before_lowering.carbon index c5cde99a113f..563de99f6214 100644 --- a/toolchain/lower/testdata/basics/fail_before_lowering.carbon +++ b/toolchain/lower/testdata/basics/fail_before_lowering.carbon @@ -9,11 +9,12 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/basics/fail_before_lowering.carbon -// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+7]]:1: error: unrecognized declaration introducer [UnrecognizedDecl] +// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+8]]:1: error: unrecognized declaration introducer [UnrecognizedDecl] // CHECK:STDERR: a; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+3]]:1: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] +// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+4]]:1: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] // CHECK:STDERR: a; // CHECK:STDERR: ^ +// CHECK:STDERR: a; diff --git a/toolchain/parse/testdata/alias/fail_syntax.carbon b/toolchain/parse/testdata/alias/fail_syntax.carbon index b00c42757c2b..ba07d7d40e1d 100644 --- a/toolchain/parse/testdata/alias/fail_syntax.carbon +++ b/toolchain/parse/testdata/alias/fail_syntax.carbon @@ -72,9 +72,10 @@ fn F() { alias a = b -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+56]]:21: error: `alias` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+57]]:21: error: `alias` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_syntax.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, diff --git a/toolchain/parse/testdata/array/fail_require_close_bracket.carbon b/toolchain/parse/testdata/array/fail_require_close_bracket.carbon index 77584ce69bb7..3399060b7573 100644 --- a/toolchain/parse/testdata/array/fail_require_close_bracket.carbon +++ b/toolchain/parse/testdata/array/fail_require_close_bracket.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/array/fail_require_close_bracket.carbon // TODO: It should emit only one error message. -// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+3]]:8: error: opening symbol without a corresponding closing symbol [UnmatchedOpening] +// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+4]]:8: error: opening symbol without a corresponding closing symbol [UnmatchedOpening] // CHECK:STDERR: var x: [i32;; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: [i32;; // CHECK:STDOUT: - filename: fail_require_close_bracket.carbon diff --git a/toolchain/parse/testdata/array/fail_require_semi.carbon b/toolchain/parse/testdata/array/fail_require_semi.carbon index a40746f9af74..442a724cf3e1 100644 --- a/toolchain/parse/testdata/array/fail_require_semi.carbon +++ b/toolchain/parse/testdata/array/fail_require_semi.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/array/fail_require_semi.carbon -// CHECK:STDERR: fail_require_semi.carbon:[[@LINE+3]]:12: error: expected `;` in array type [ExpectedArraySemi] +// CHECK:STDERR: fail_require_semi.carbon:[[@LINE+4]]:12: error: expected `;` in array type [ExpectedArraySemi] // CHECK:STDERR: var x: [i32]; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: [i32]; // CHECK:STDOUT: - filename: fail_require_semi.carbon diff --git a/toolchain/parse/testdata/array/fail_syntax.carbon b/toolchain/parse/testdata/array/fail_syntax.carbon index e3527b08e685..66d97e6bcfab 100644 --- a/toolchain/parse/testdata/array/fail_syntax.carbon +++ b/toolchain/parse/testdata/array/fail_syntax.carbon @@ -62,9 +62,10 @@ var x: [i32;; // --- fail_no_semi.carbon -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:12: error: expected `;` in array type [ExpectedArraySemi] +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+4]]:12: error: expected `;` in array type [ExpectedArraySemi] // CHECK:STDERR: var x: [i32]; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: [i32]; // CHECK:STDOUT: - filename: fail_type.carbon diff --git a/toolchain/parse/testdata/basics/fail_bracket_recovery.carbon b/toolchain/parse/testdata/basics/fail_bracket_recovery.carbon index af36800e4668..d661c2fd1af1 100644 --- a/toolchain/parse/testdata/basics/fail_bracket_recovery.carbon +++ b/toolchain/parse/testdata/basics/fail_bracket_recovery.carbon @@ -15,17 +15,18 @@ fn F() { // CHECK:STDERR: ^ // CHECK:STDERR: var x: ([i32; 3) = (0, 1, 2); - // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+11]]:15: error: opening symbol without a corresponding closing symbol [UnmatchedOpening] + // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+12]]:15: error: opening symbol without a corresponding closing symbol [UnmatchedOpening] // CHECK:STDERR: var x: {.y: (} = {.y = ((}; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+7]]:26: error: opening symbol without a corresponding closing symbol [UnmatchedOpening] + // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+8]]:26: error: opening symbol without a corresponding closing symbol [UnmatchedOpening] // CHECK:STDERR: var x: {.y: (} = {.y = ((}; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+3]]:27: error: opening symbol without a corresponding closing symbol [UnmatchedOpening] + // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+4]]:27: error: opening symbol without a corresponding closing symbol [UnmatchedOpening] // CHECK:STDERR: var x: {.y: (} = {.y = ((}; // CHECK:STDERR: ^ + // CHECK:STDERR: var x: {.y: (} = {.y = ((}; } diff --git a/toolchain/parse/testdata/basics/fail_invalid_designators.carbon b/toolchain/parse/testdata/basics/fail_invalid_designators.carbon index 29ab7997f05e..40c4be50bc11 100644 --- a/toolchain/parse/testdata/basics/fail_invalid_designators.carbon +++ b/toolchain/parse/testdata/basics/fail_invalid_designators.carbon @@ -15,9 +15,10 @@ fn F() { // CHECK:STDERR: ^ // CHECK:STDERR: a.; - // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] + // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+4]]:5: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] // CHECK:STDERR: a.fn; // CHECK:STDERR: ^~ + // CHECK:STDERR: a.fn; } diff --git a/toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon b/toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon index f07dc53fc4eb..47c48cb94046 100644 --- a/toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon +++ b/toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon -// CHECK:STDERR: fail_modifiers_before_semi.carbon:[[@LINE+3]]:18: error: unrecognized declaration introducer [UnrecognizedDecl] +// CHECK:STDERR: fail_modifiers_before_semi.carbon:[[@LINE+4]]:18: error: unrecognized declaration introducer [UnrecognizedDecl] // CHECK:STDERR: protected virtual; // CHECK:STDERR: ^ +// CHECK:STDERR: protected virtual; // CHECK:STDOUT: - filename: fail_modifiers_before_semi.carbon diff --git a/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon b/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon index 8370169ccf5c..b2c98ba33873 100644 --- a/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon +++ b/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon -// CHECK:STDERR: fail_no_intro_with_semi.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer [UnrecognizedDecl] +// CHECK:STDERR: fail_no_intro_with_semi.carbon:[[@LINE+4]]:1: error: unrecognized declaration introducer [UnrecognizedDecl] // CHECK:STDERR: foo; // CHECK:STDERR: ^~~ +// CHECK:STDERR: foo; // CHECK:STDOUT: - filename: fail_no_intro_with_semi.carbon diff --git a/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon b/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon index 3d119b08615d..b57604bebdb2 100644 --- a/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon +++ b/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon -// CHECK:STDERR: fail_no_intro_without_semi.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer [UnrecognizedDecl] +// CHECK:STDERR: fail_no_intro_without_semi.carbon:[[@LINE+4]]:1: error: unrecognized declaration introducer [UnrecognizedDecl] // CHECK:STDERR: foo bar baz // CHECK:STDERR: ^~~ +// CHECK:STDERR: foo bar baz // CHECK:STDOUT: - filename: fail_no_intro_without_semi.carbon diff --git a/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon b/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon index 0003b7339bc8..b80023bf6337 100644 --- a/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon +++ b/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon @@ -18,9 +18,10 @@ // CHECK:STDERR: var = (foo {}) -// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+16]]:21: error: `var` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+17]]:21: error: `var` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_paren_match_regression.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, diff --git a/toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon b/toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon index 0f42830d1be5..1ff7149a1ab4 100644 --- a/toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon +++ b/toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon choice X { - // CHECK:STDERR: fail_alternative_with_implicit_params.carbon:[[@LINE+3]]:4: error: expected `,` or `}` [UnexpectedTokenAfterListElement] + // CHECK:STDERR: fail_alternative_with_implicit_params.carbon:[[@LINE+4]]:4: error: expected `,` or `}` [UnexpectedTokenAfterListElement] // CHECK:STDERR: A[T:! type](value: T) // CHECK:STDERR: ^ + // CHECK:STDERR: A[T:! type](value: T) } diff --git a/toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon b/toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon index 77e8d5b656bf..3fa675992d63 100644 --- a/toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon +++ b/toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon @@ -14,9 +14,10 @@ choice InvalidAlternativeIdentifier { // CHECK:STDERR: ^ // CHECK:STDERR: ,Some, - // CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+3]]:5: error: expected choice alternative name [ExpectedChoiceAlternativeName] + // CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+4]]:5: error: expected choice alternative name [ExpectedChoiceAlternativeName] // CHECK:STDERR: 42, // CHECK:STDERR: ^~ + // CHECK:STDERR: 42, Other } diff --git a/toolchain/parse/testdata/choice/fail_invalid_braces.carbon b/toolchain/parse/testdata/choice/fail_invalid_braces.carbon index d1180d1f86b9..c89711bba189 100644 --- a/toolchain/parse/testdata/choice/fail_invalid_braces.carbon +++ b/toolchain/parse/testdata/choice/fail_invalid_braces.carbon @@ -14,9 +14,10 @@ // CHECK:STDERR: choice InvalidBraces | Some -// CHECK:STDERR: fail_invalid_braces.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer [UnrecognizedDecl] +// CHECK:STDERR: fail_invalid_braces.carbon:[[@LINE+4]]:1: error: unrecognized declaration introducer [UnrecognizedDecl] // CHECK:STDERR: | // CHECK:STDERR: ^ +// CHECK:STDERR: | // CHECK:STDOUT: - filename: fail_invalid_braces.carbon diff --git a/toolchain/parse/testdata/choice/fail_missing_definition.carbon b/toolchain/parse/testdata/choice/fail_missing_definition.carbon index 2d23da8fabd9..4b1920d4854a 100644 --- a/toolchain/parse/testdata/choice/fail_missing_definition.carbon +++ b/toolchain/parse/testdata/choice/fail_missing_definition.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_missing_definition.carbon -// CHECK:STDERR: fail_missing_definition.carbon:[[@LINE+3]]:25: error: choice definition expected [ExpectedChoiceDefinition] +// CHECK:STDERR: fail_missing_definition.carbon:[[@LINE+4]]:25: error: choice definition expected [ExpectedChoiceDefinition] // CHECK:STDERR: choice MissingDefinition; // CHECK:STDERR: ^ +// CHECK:STDERR: choice MissingDefinition; // CHECK:STDOUT: - filename: fail_missing_definition.carbon diff --git a/toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon b/toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon index 3f0148858904..b5ba62f42bc1 100644 --- a/toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon +++ b/toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon -// CHECK:STDERR: fail_missing_definition_parameterized.carbon:[[@LINE+3]]:35: error: choice definition expected [ExpectedChoiceDefinition] +// CHECK:STDERR: fail_missing_definition_parameterized.carbon:[[@LINE+4]]:35: error: choice definition expected [ExpectedChoiceDefinition] // CHECK:STDERR: choice MissingDefinition(T:! type); // CHECK:STDERR: ^ +// CHECK:STDERR: choice MissingDefinition(T:! type); // CHECK:STDOUT: - filename: fail_missing_definition_parameterized.carbon diff --git a/toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon b/toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon index c3f3fc08ac69..c1e7409c0ca6 100644 --- a/toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon +++ b/toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon choice X { - // CHECK:STDERR: fail_qualified_alternative_name.carbon:[[@LINE+3]]:4: error: expected `,` or `}` [UnexpectedTokenAfterListElement] + // CHECK:STDERR: fail_qualified_alternative_name.carbon:[[@LINE+4]]:4: error: expected `,` or `}` [UnexpectedTokenAfterListElement] // CHECK:STDERR: A.B // CHECK:STDERR: ^ + // CHECK:STDERR: A.B } diff --git a/toolchain/parse/testdata/class/adapt.carbon b/toolchain/parse/testdata/class/adapt.carbon index 2d3b64f61301..4a2efdb02753 100644 --- a/toolchain/parse/testdata/class/adapt.carbon +++ b/toolchain/parse/testdata/class/adapt.carbon @@ -60,9 +60,10 @@ class C { } class D { - // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+3]]:9: error: expected expression [ExpectedExpr] + // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:9: error: expected expression [ExpectedExpr] // CHECK:STDERR: adapt class; // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: adapt class; } diff --git a/toolchain/parse/testdata/class/fail_base.carbon b/toolchain/parse/testdata/class/fail_base.carbon index 97d4ae62208b..bb2cc1f1cc08 100644 --- a/toolchain/parse/testdata/class/fail_base.carbon +++ b/toolchain/parse/testdata/class/fail_base.carbon @@ -23,13 +23,14 @@ class A { base: { } // We should resume parsing here after the previous error. - // CHECK:STDERR: fail_base.carbon:[[@LINE+7]]:3: error: `base` declarations must end with a `;` [ExpectedDeclSemi] + // CHECK:STDERR: fail_base.carbon:[[@LINE+8]]:3: error: `base` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: var n: i32; // CHECK:STDERR: ^~~ // CHECK:STDERR: - // CHECK:STDERR: fail_base.carbon:[[@LINE+3]]:7: error: unrecognized declaration introducer [UnrecognizedDecl] + // CHECK:STDERR: fail_base.carbon:[[@LINE+4]]:7: error: unrecognized declaration introducer [UnrecognizedDecl] // CHECK:STDERR: var n: i32; // CHECK:STDERR: ^ + // CHECK:STDERR: var n: i32; } diff --git a/toolchain/parse/testdata/class/fail_modifiers.carbon b/toolchain/parse/testdata/class/fail_modifiers.carbon index d636e9d7e1d1..68758e96c75e 100644 --- a/toolchain/parse/testdata/class/fail_modifiers.carbon +++ b/toolchain/parse/testdata/class/fail_modifiers.carbon @@ -27,9 +27,10 @@ impl class // --- fail_extend_adapt_base.carbon class C { - // CHECK:STDERR: fail_extend_adapt_base.carbon:[[@LINE+3]]:16: error: expected expression [ExpectedExpr] + // CHECK:STDERR: fail_extend_adapt_base.carbon:[[@LINE+4]]:16: error: expected expression [ExpectedExpr] // CHECK:STDERR: extend adapt base B; // CHECK:STDERR: ^~~~ + // CHECK:STDERR: extend adapt base B; } diff --git a/toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon b/toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon index 42291f69d96f..5ddd3f31649b 100644 --- a/toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon +++ b/toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon fn foo() { - // CHECK:STDERR: fail_colon_instead_of_in.carbon:[[@LINE+3]]:19: error: `:` should be replaced by `in` [ExpectedInNotColon] + // CHECK:STDERR: fail_colon_instead_of_in.carbon:[[@LINE+4]]:19: error: `:` should be replaced by `in` [ExpectedInNotColon] // CHECK:STDERR: for (var x: i32 : y) { // CHECK:STDERR: ^ + // CHECK:STDERR: for (var x: i32 : y) { Print(x); } diff --git a/toolchain/parse/testdata/for/fail_missing_cond.carbon b/toolchain/parse/testdata/for/fail_missing_cond.carbon index 9fb55398e01c..0bf46d24d6b8 100644 --- a/toolchain/parse/testdata/for/fail_missing_cond.carbon +++ b/toolchain/parse/testdata/for/fail_missing_cond.carbon @@ -19,13 +19,14 @@ fn F() { // CHECK:STDERR: for { } -// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+7]]:1: error: expected braced code block [ExpectedCodeBlock] +// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+8]]:1: error: expected braced code block [ExpectedCodeBlock] // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:1: error: expected expression [ExpectedExpr] +// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+4]]:1: error: expected expression [ExpectedExpr] // CHECK:STDERR: } // CHECK:STDERR: ^ +// CHECK:STDERR: } // CHECK:STDOUT: - filename: fail_missing_cond.carbon diff --git a/toolchain/parse/testdata/for/fail_missing_in.carbon b/toolchain/parse/testdata/for/fail_missing_in.carbon index 30c848a9e0e2..f7fe27a11625 100644 --- a/toolchain/parse/testdata/for/fail_missing_in.carbon +++ b/toolchain/parse/testdata/for/fail_missing_in.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_missing_in.carbon fn foo() { - // CHECK:STDERR: fail_missing_in.carbon:[[@LINE+3]]:19: error: expected `in` after loop `var` declaration [ExpectedIn] + // CHECK:STDERR: fail_missing_in.carbon:[[@LINE+4]]:19: error: expected `in` after loop `var` declaration [ExpectedIn] // CHECK:STDERR: for (var x: i32 y) { // CHECK:STDERR: ^ + // CHECK:STDERR: for (var x: i32 y) { Print(x); } diff --git a/toolchain/parse/testdata/for/fail_missing_var.carbon b/toolchain/parse/testdata/for/fail_missing_var.carbon index cbe47c6f3d9f..6d8640cb345b 100644 --- a/toolchain/parse/testdata/for/fail_missing_var.carbon +++ b/toolchain/parse/testdata/for/fail_missing_var.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_missing_var.carbon fn foo() { - // CHECK:STDERR: fail_missing_var.carbon:[[@LINE+3]]:8: error: expected `var` declaration [ExpectedVariableDecl] + // CHECK:STDERR: fail_missing_var.carbon:[[@LINE+4]]:8: error: expected `var` declaration [ExpectedVariableDecl] // CHECK:STDERR: for (x: i32 in y) { // CHECK:STDERR: ^ + // CHECK:STDERR: for (x: i32 in y) { Print(x); } diff --git a/toolchain/parse/testdata/for/fail_returned_var.carbon b/toolchain/parse/testdata/for/fail_returned_var.carbon index f7da37a5b825..fc876bba70a1 100644 --- a/toolchain/parse/testdata/for/fail_returned_var.carbon +++ b/toolchain/parse/testdata/for/fail_returned_var.carbon @@ -10,9 +10,10 @@ fn foo() -> i32 { // TODO: Should we allow this? - // CHECK:STDERR: fail_returned_var.carbon:[[@LINE+3]]:8: error: expected `var` declaration [ExpectedVariableDecl] + // CHECK:STDERR: fail_returned_var.carbon:[[@LINE+4]]:8: error: expected `var` declaration [ExpectedVariableDecl] // CHECK:STDERR: for (returned var x: i32 in y) { // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: for (returned var x: i32 in y) { return var; } diff --git a/toolchain/parse/testdata/for/fail_square_brackets.carbon b/toolchain/parse/testdata/for/fail_square_brackets.carbon index df4447e57175..a5f595a66fb3 100644 --- a/toolchain/parse/testdata/for/fail_square_brackets.carbon +++ b/toolchain/parse/testdata/for/fail_square_brackets.carbon @@ -9,21 +9,22 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_square_brackets.carbon fn F() { - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+15]]:7: error: expected `(` after `for` [ExpectedParenAfter] + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+16]]:7: error: expected `(` after `for` [ExpectedParenAfter] // CHECK:STDERR: for [] { // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+11]]:7: error: expected `var` declaration [ExpectedVariableDecl] + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+12]]:7: error: expected `var` declaration [ExpectedVariableDecl] // CHECK:STDERR: for [] { // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+7]]:8: error: expected expression [ExpectedExpr] + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+8]]:8: error: expected expression [ExpectedExpr] // CHECK:STDERR: for [] { // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:8: error: expected `;` in array type [ExpectedArraySemi] + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+4]]:8: error: expected `;` in array type [ExpectedArraySemi] // CHECK:STDERR: for [] { // CHECK:STDERR: ^ + // CHECK:STDERR: for [] { } } diff --git a/toolchain/parse/testdata/function/declaration/extern.carbon b/toolchain/parse/testdata/function/declaration/extern.carbon index af6f6d8a276f..ab6c8049daee 100644 --- a/toolchain/parse/testdata/function/declaration/extern.carbon +++ b/toolchain/parse/testdata/function/declaration/extern.carbon @@ -30,13 +30,14 @@ extern library fn G(); // --- fail_identifier.carbon -// CHECK:STDERR: fail_identifier.carbon:[[@LINE+7]]:16: error: expected `default` or a string literal to specify the library name [ExpectedLibraryNameOrDefault] +// CHECK:STDERR: fail_identifier.carbon:[[@LINE+8]]:16: error: expected `default` or a string literal to specify the library name [ExpectedLibraryNameOrDefault] // CHECK:STDERR: extern library foo fn G(); // CHECK:STDERR: ^~~ // CHECK:STDERR: -// CHECK:STDERR: fail_identifier.carbon:[[@LINE+3]]:16: error: unrecognized declaration introducer [UnrecognizedDecl] +// CHECK:STDERR: fail_identifier.carbon:[[@LINE+4]]:16: error: unrecognized declaration introducer [UnrecognizedDecl] // CHECK:STDERR: extern library foo fn G(); // CHECK:STDERR: ^~~ +// CHECK:STDERR: extern library foo fn G(); // CHECK:STDOUT: - filename: extern.carbon diff --git a/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon b/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon index 4e22b2268bb2..faeed0a495bb 100644 --- a/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon -// CHECK:STDERR: fail_identifier_instead_of_sig.carbon:[[@LINE+3]]:8: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition [ExpectedDeclSemiOrDefinition] +// CHECK:STDERR: fail_identifier_instead_of_sig.carbon:[[@LINE+4]]:8: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition [ExpectedDeclSemiOrDefinition] // CHECK:STDERR: fn foo bar; // CHECK:STDERR: ^~~ +// CHECK:STDERR: fn foo bar; // CHECK:STDOUT: - filename: fail_identifier_instead_of_sig.carbon diff --git a/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon b/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon index be0d9dba9085..719c393789ad 100644 --- a/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon @@ -9,13 +9,14 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon // Fix and uncomment this to test error handling. -// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+7]]:7: error: opening symbol without a corresponding closing symbol [UnmatchedOpening] +// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+8]]:7: error: opening symbol without a corresponding closing symbol [UnmatchedOpening] // CHECK:STDERR: fn Div[(); // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+3]]:7: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition [ExpectedDeclSemiOrDefinition] +// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+4]]:7: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition [ExpectedDeclSemiOrDefinition] // CHECK:STDERR: fn Div[(); // CHECK:STDERR: ^ +// CHECK:STDERR: fn Div[(); // CHECK:STDOUT: - filename: fail_missing_implicit_close.carbon diff --git a/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon b/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon index 2abab4230d57..d71fc4b01eca 100644 --- a/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_missing_name.carbon -// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName] +// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+4]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName] // CHECK:STDERR: fn (); // CHECK:STDERR: ^ +// CHECK:STDERR: fn (); // CHECK:STDOUT: - filename: fail_missing_name.carbon diff --git a/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon index 63a9e0ee5425..b74fb4b2aefd 100644 --- a/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon @@ -10,9 +10,10 @@ fn foo -// CHECK:STDERR: fail_no_sig_or_semi.carbon:[[@LINE+10]]:21: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition [ExpectedDeclSemiOrDefinition] +// CHECK:STDERR: fail_no_sig_or_semi.carbon:[[@LINE+11]]:21: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition [ExpectedDeclSemiOrDefinition] // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_no_sig_or_semi.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, diff --git a/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon index cb9b61630975..08286af1ae52 100644 --- a/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon -// CHECK:STDERR: fail_only_fn_and_semi.carbon:[[@LINE+3]]:3: error: `fn` introducer should be followed by a name [ExpectedDeclName] +// CHECK:STDERR: fail_only_fn_and_semi.carbon:[[@LINE+4]]:3: error: `fn` introducer should be followed by a name [ExpectedDeclName] // CHECK:STDERR: fn; // CHECK:STDERR: ^ +// CHECK:STDERR: fn; // CHECK:STDOUT: - filename: fail_only_fn_and_semi.carbon diff --git a/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon index 0d133480882c..dc423b057bf3 100644 --- a/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon -// CHECK:STDERR: fail_repeated_fn_and_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName] +// CHECK:STDERR: fail_repeated_fn_and_semi.carbon:[[@LINE+4]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName] // CHECK:STDERR: fn fn; // CHECK:STDERR: ^~ +// CHECK:STDERR: fn fn; // CHECK:STDOUT: - filename: fail_repeated_fn_and_semi.carbon diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon index a7e84e1baba4..2fd6f9a16719 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon - // CHECK:STDERR: fail_skip_indented_newline_until_outdent.carbon:[[@LINE+3]]:6: error: `fn` introducer should be followed by a name [ExpectedDeclName] + // CHECK:STDERR: fail_skip_indented_newline_until_outdent.carbon:[[@LINE+4]]:6: error: `fn` introducer should be followed by a name [ExpectedDeclName] // CHECK:STDERR: fn (x, // CHECK:STDERR: ^ + // CHECK:STDERR: fn (x, y, z) diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon index a49ecc8b4af7..7f6c04d36831 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon -// CHECK:STDERR: fail_skip_indented_newline_with_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName] +// CHECK:STDERR: fail_skip_indented_newline_with_semi.carbon:[[@LINE+4]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName] // CHECK:STDERR: fn (x, // CHECK:STDERR: ^ +// CHECK:STDERR: fn (x, y, z); diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon index 367cc3fe5fc9..df96cbecac06 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon -// CHECK:STDERR: fail_skip_indented_newline_without_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName] +// CHECK:STDERR: fail_skip_indented_newline_without_semi.carbon:[[@LINE+4]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName] // CHECK:STDERR: fn (x, // CHECK:STDERR: ^ +// CHECK:STDERR: fn (x, y, z) diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon index 569f33ba28fc..7f2585ae6c00 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon -// CHECK:STDERR: fail_skip_to_newline_without_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName] +// CHECK:STDERR: fail_skip_to_newline_without_semi.carbon:[[@LINE+4]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName] // CHECK:STDERR: fn () // CHECK:STDERR: ^ +// CHECK:STDERR: fn () fn F(); diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon index d63d38f1ff1d..6ec74baac1ff 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon -// CHECK:STDERR: fail_skip_without_semi_to_curly.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer [UnrecognizedDecl] +// CHECK:STDERR: fail_skip_without_semi_to_curly.carbon:[[@LINE+4]]:1: error: unrecognized declaration introducer [UnrecognizedDecl] // CHECK:STDERR: struct X { fn () } // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: struct X { fn () } fn F(); diff --git a/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon b/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon index 029da10ad245..034048656208 100644 --- a/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon -// CHECK:STDERR: fail_with_identifier_as_param.carbon:[[@LINE+3]]:11: error: expected `:` or `:!` in binding pattern [ExpectedBindingPattern] +// CHECK:STDERR: fail_with_identifier_as_param.carbon:[[@LINE+4]]:11: error: expected `:` or `:!` in binding pattern [ExpectedBindingPattern] // CHECK:STDERR: fn foo(bar); // CHECK:STDERR: ^ +// CHECK:STDERR: fn foo(bar); // CHECK:STDOUT: - filename: fail_with_identifier_as_param.carbon diff --git a/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon b/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon index 156db7e254de..d7c17fa26c57 100644 --- a/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon -// CHECK:STDERR: fail_without_name_and_many_tokens_in_params.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName] +// CHECK:STDERR: fail_without_name_and_many_tokens_in_params.carbon:[[@LINE+4]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName] // CHECK:STDERR: fn (a tokens c d e f g h i j k l m n o p q r s t u v w x y z); // CHECK:STDERR: ^ +// CHECK:STDERR: fn (a tokens c d e f g h i j k l m n o p q r s t u v w x y z); // CHECK:STDOUT: - filename: fail_without_name_and_many_tokens_in_params.carbon diff --git a/toolchain/parse/testdata/function/definition/fail_builtin.carbon b/toolchain/parse/testdata/function/definition/fail_builtin.carbon index 7f10fe60f656..cba5b2052fae 100644 --- a/toolchain/parse/testdata/function/definition/fail_builtin.carbon +++ b/toolchain/parse/testdata/function/definition/fail_builtin.carbon @@ -19,9 +19,10 @@ fn NotString() = banana; // CHECK:STDERR: fn JunkAfterString() = "hello" "world"; -// CHECK:STDERR: fail_builtin.carbon:[[@LINE+3]]:23: error: expected builtin function name after `=` [ExpectedBuiltinName] +// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:23: error: expected builtin function name after `=` [ExpectedBuiltinName] // CHECK:STDERR: fn SpuriousEquals() = { } // CHECK:STDERR: ^ +// CHECK:STDERR: fn SpuriousEquals() = { } fn TestRecoveryFromSpuriousEquals(); diff --git a/toolchain/parse/testdata/function/definition/fail_identifier_in_statements.carbon b/toolchain/parse/testdata/function/definition/fail_identifier_in_statements.carbon index bdf83bbc4a20..622e10424ddd 100644 --- a/toolchain/parse/testdata/function/definition/fail_identifier_in_statements.carbon +++ b/toolchain/parse/testdata/function/definition/fail_identifier_in_statements.carbon @@ -12,9 +12,10 @@ fn F() { // Note: this might become valid depending on the expression syntax. This test // shouldn't be taken as a sign it should remain invalid. bar -// CHECK:STDERR: fail_identifier_in_statements.carbon:[[@LINE+3]]:1: error: expected `;` after expression statement [ExpectedExprSemi] +// CHECK:STDERR: fail_identifier_in_statements.carbon:[[@LINE+4]]:1: error: expected `;` after expression statement [ExpectedExprSemi] // CHECK:STDERR: } // CHECK:STDERR: ^ +// CHECK:STDERR: } // CHECK:STDOUT: - filename: fail_identifier_in_statements.carbon diff --git a/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon b/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon index 6df47948ff42..f87cb8337f6f 100644 --- a/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon +++ b/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon @@ -26,9 +26,10 @@ class Foo[a: i32]; // CHECK:STDERR: interface Bar[] {} -// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+3]]:23: error: a `(` for parameters is required after implicit parameters [ParamsRequiredAfterImplicit] +// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:23: error: a `(` for parameters is required after implicit parameters [ParamsRequiredAfterImplicit] // CHECK:STDERR: interface Bar[a: i32] {} // CHECK:STDERR: ^ +// CHECK:STDERR: interface Bar[a: i32] {} // CHECK:STDOUT: - filename: fail_no_parens.carbon diff --git a/toolchain/parse/testdata/generics/impl/fail_impl.carbon b/toolchain/parse/testdata/generics/impl/fail_impl.carbon index 64b0a695f591..6dcd4c5f052e 100644 --- a/toolchain/parse/testdata/generics/impl/fail_impl.carbon +++ b/toolchain/parse/testdata/generics/impl/fail_impl.carbon @@ -96,9 +96,10 @@ impl; impl -// CHECK:STDERR: fail_impl.carbon:[[@LINE+88]]:21: error: expected expression [ExpectedExpr] +// CHECK:STDERR: fail_impl.carbon:[[@LINE+89]]:21: error: expected expression [ExpectedExpr] // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_impl.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, diff --git a/toolchain/parse/testdata/generics/impl/fail_out_of_line_member.carbon b/toolchain/parse/testdata/generics/impl/fail_out_of_line_member.carbon index 63fb4337720e..83574fcb37ac 100644 --- a/toolchain/parse/testdata/generics/impl/fail_out_of_line_member.carbon +++ b/toolchain/parse/testdata/generics/impl/fail_out_of_line_member.carbon @@ -30,9 +30,10 @@ class C { } } -// CHECK:STDERR: fail_out_of_line_member.carbon:[[@LINE+3]]:6: error: `.` should be followed by a name [ExpectedDeclNameAfterPeriod] +// CHECK:STDERR: fail_out_of_line_member.carbon:[[@LINE+4]]:6: error: `.` should be followed by a name [ExpectedDeclNameAfterPeriod] // CHECK:STDERR: fn C.(Self as Interface).F() {} // CHECK:STDERR: ^ +// CHECK:STDERR: fn C.(Self as Interface).F() {} // CHECK:STDOUT: - filename: fail_out_of_line_member.carbon diff --git a/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon b/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon index b37a609f7c5b..9ac540879e62 100644 --- a/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon +++ b/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/fail_missing_name.carbon -// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:11: error: `interface` introducer should be followed by a name [ExpectedDeclName] +// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+4]]:11: error: `interface` introducer should be followed by a name [ExpectedDeclName] // CHECK:STDERR: interface { // CHECK:STDERR: ^ +// CHECK:STDERR: interface { } diff --git a/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon b/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon index 92dc39cc1af0..94e0b056ca0b 100644 --- a/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon +++ b/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon @@ -16,9 +16,10 @@ interface Bar Baz {} interface Foo -// CHECK:STDERR: fail_missing_open_curly.carbon:[[@LINE+13]]:21: error: `interface` declarations must either end with a `;` or have a `{ ... }` block for a definition [ExpectedDeclSemiOrDefinition] +// CHECK:STDERR: fail_missing_open_curly.carbon:[[@LINE+14]]:21: error: `interface` declarations must either end with a `;` or have a `{ ... }` block for a definition [ExpectedDeclSemiOrDefinition] // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_missing_open_curly.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, diff --git a/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon b/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon index 49f0f76a88e1..e9809dc0887a 100644 --- a/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon +++ b/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon @@ -15,9 +15,10 @@ interface Foo { // CHECK:STDERR: fn Sub[me Self](b: Self) -> Self; - // CHECK:STDERR: fail_self_param_syntax.carbon:[[@LINE+3]]:10: error: expected name in binding pattern [ExpectedBindingPattern] + // CHECK:STDERR: fail_self_param_syntax.carbon:[[@LINE+4]]:10: error: expected name in binding pattern [ExpectedBindingPattern] // CHECK:STDERR: fn Mul[Self](b: Self) -> Self; // CHECK:STDERR: ^~~~ + // CHECK:STDERR: fn Mul[Self](b: Self) -> Self; } diff --git a/toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon b/toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon index cd192bc8d701..d3713d331de4 100644 --- a/toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon +++ b/toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon @@ -14,9 +14,10 @@ // CHECK:STDERR: constraint "Foo" -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: error: `constraint` introducer should be followed by a name [ExpectedDeclName] +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:1: error: `constraint` introducer should be followed by a name [ExpectedDeclName] // CHECK:STDERR: constraint // CHECK:STDERR: ^~~~~~~~~~ +// CHECK:STDERR: constraint // CHECK:STDOUT: - filename: fail_incomplete.carbon diff --git a/toolchain/parse/testdata/if/fail_else_unbraced.carbon b/toolchain/parse/testdata/if/fail_else_unbraced.carbon index e08c62a3cfcb..d3d1e746e703 100644 --- a/toolchain/parse/testdata/if/fail_else_unbraced.carbon +++ b/toolchain/parse/testdata/if/fail_else_unbraced.carbon @@ -27,9 +27,10 @@ fn F() { // CHECK:STDERR: d; else - // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+3]]:5: error: expected braced code block [ExpectedCodeBlock] + // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:5: error: expected braced code block [ExpectedCodeBlock] // CHECK:STDERR: e; // CHECK:STDERR: ^ + // CHECK:STDERR: e; if (x) { f; } else if (x) { g; } diff --git a/toolchain/parse/testdata/if/fail_errors.carbon b/toolchain/parse/testdata/if/fail_errors.carbon index c5de9be55b7a..0d7ef8e1f227 100644 --- a/toolchain/parse/testdata/if/fail_errors.carbon +++ b/toolchain/parse/testdata/if/fail_errors.carbon @@ -25,13 +25,14 @@ fn F() { // CHECK:STDERR: if (b c) {} if (d) -// CHECK:STDERR: fail_errors.carbon:[[@LINE+7]]:1: error: expected braced code block [ExpectedCodeBlock] +// CHECK:STDERR: fail_errors.carbon:[[@LINE+8]]:1: error: expected braced code block [ExpectedCodeBlock] // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_errors.carbon:[[@LINE+3]]:1: error: expected expression [ExpectedExpr] +// CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:1: error: expected expression [ExpectedExpr] // CHECK:STDERR: } // CHECK:STDERR: ^ +// CHECK:STDERR: } // CHECK:STDOUT: - filename: fail_errors.carbon diff --git a/toolchain/parse/testdata/if/fail_missing_cond.carbon b/toolchain/parse/testdata/if/fail_missing_cond.carbon index d9a773601357..b2379b5428f0 100644 --- a/toolchain/parse/testdata/if/fail_missing_cond.carbon +++ b/toolchain/parse/testdata/if/fail_missing_cond.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if/fail_missing_cond.carbon fn F() { - // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:6: error: expected `(` after `if` [ExpectedParenAfter] + // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+4]]:6: error: expected `(` after `if` [ExpectedParenAfter] // CHECK:STDERR: if { // CHECK:STDERR: ^ + // CHECK:STDERR: if { } } diff --git a/toolchain/parse/testdata/if/fail_square_brackets.carbon b/toolchain/parse/testdata/if/fail_square_brackets.carbon index 336b73779bdb..2a270e73a316 100644 --- a/toolchain/parse/testdata/if/fail_square_brackets.carbon +++ b/toolchain/parse/testdata/if/fail_square_brackets.carbon @@ -9,17 +9,18 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if/fail_square_brackets.carbon fn F() { - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+11]]:6: error: expected `(` after `if` [ExpectedParenAfter] + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+12]]:6: error: expected `(` after `if` [ExpectedParenAfter] // CHECK:STDERR: if [] {} // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+7]]:7: error: expected expression [ExpectedExpr] + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+8]]:7: error: expected expression [ExpectedExpr] // CHECK:STDERR: if [] {} // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:7: error: expected `;` in array type [ExpectedArraySemi] + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+4]]:7: error: expected `;` in array type [ExpectedArraySemi] // CHECK:STDERR: if [] {} // CHECK:STDERR: ^ + // CHECK:STDERR: if [] {} } diff --git a/toolchain/parse/testdata/if/fail_unbraced.carbon b/toolchain/parse/testdata/if/fail_unbraced.carbon index 4633aeaddacb..b21a4d7e7247 100644 --- a/toolchain/parse/testdata/if/fail_unbraced.carbon +++ b/toolchain/parse/testdata/if/fail_unbraced.carbon @@ -21,9 +21,10 @@ fn F() { // CHECK:STDERR: ^~ // CHECK:STDERR: if (c) - // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+3]]:9: error: expected braced code block [ExpectedCodeBlock] + // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+4]]:9: error: expected braced code block [ExpectedCodeBlock] // CHECK:STDERR: d; // CHECK:STDERR: ^ + // CHECK:STDERR: d; } diff --git a/toolchain/parse/testdata/if_expr/fail_condition_missing.carbon b/toolchain/parse/testdata/if_expr/fail_condition_missing.carbon index 87310c8f98ae..2c3d59d64bde 100644 --- a/toolchain/parse/testdata/if_expr/fail_condition_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_condition_missing.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_condition_missing.carbon fn F() { - // CHECK:STDERR: fail_condition_missing.carbon:[[@LINE+3]]:18: error: expected expression [ExpectedExpr] + // CHECK:STDERR: fail_condition_missing.carbon:[[@LINE+4]]:18: error: expected expression [ExpectedExpr] // CHECK:STDERR: var n: i32 = if; // CHECK:STDERR: ^ + // CHECK:STDERR: var n: i32 = if; } diff --git a/toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon b/toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon index 0a2e726d6e3e..5e03779e7323 100644 --- a/toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon fn F() { - // CHECK:STDERR: fail_else_expr_missing.carbon:[[@LINE+3]]:35: error: expected expression [ExpectedExpr] + // CHECK:STDERR: fail_else_expr_missing.carbon:[[@LINE+4]]:35: error: expected expression [ExpectedExpr] // CHECK:STDERR: var n: i32 = if true then 1 else; // CHECK:STDERR: ^ + // CHECK:STDERR: var n: i32 = if true then 1 else; } diff --git a/toolchain/parse/testdata/if_expr/fail_else_missing.carbon b/toolchain/parse/testdata/if_expr/fail_else_missing.carbon index 4f90f70df290..cee072dd30b1 100644 --- a/toolchain/parse/testdata/if_expr/fail_else_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_else_missing.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_else_missing.carbon fn F() { - // CHECK:STDERR: fail_else_missing.carbon:[[@LINE+3]]:30: error: expected `else` after `if ... then ...` [ExpectedElseAfterIf] + // CHECK:STDERR: fail_else_missing.carbon:[[@LINE+4]]:30: error: expected `else` after `if ... then ...` [ExpectedElseAfterIf] // CHECK:STDERR: var n: i32 = if true then 1; // CHECK:STDERR: ^ + // CHECK:STDERR: var n: i32 = if true then 1; } diff --git a/toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon b/toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon index 35f7d3f5e2c9..6c077f77e2ec 100644 --- a/toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon fn F() { - // CHECK:STDERR: fail_then_expr_missing.carbon:[[@LINE+3]]:28: error: expected expression [ExpectedExpr] + // CHECK:STDERR: fail_then_expr_missing.carbon:[[@LINE+4]]:28: error: expected expression [ExpectedExpr] // CHECK:STDERR: var n: i32 = if true then; // CHECK:STDERR: ^ + // CHECK:STDERR: var n: i32 = if true then; } diff --git a/toolchain/parse/testdata/if_expr/fail_then_missing.carbon b/toolchain/parse/testdata/if_expr/fail_then_missing.carbon index f343f0def9b1..355e41db3de4 100644 --- a/toolchain/parse/testdata/if_expr/fail_then_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_then_missing.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_then_missing.carbon fn F() { - // CHECK:STDERR: fail_then_missing.carbon:[[@LINE+3]]:23: error: expected `then` after `if` condition [ExpectedThenAfterIf] + // CHECK:STDERR: fail_then_missing.carbon:[[@LINE+4]]:23: error: expected `then` after `if` condition [ExpectedThenAfterIf] // CHECK:STDERR: var n: i32 = if true; // CHECK:STDERR: ^ + // CHECK:STDERR: var n: i32 = if true; } diff --git a/toolchain/parse/testdata/if_expr/fail_top_level_if.carbon b/toolchain/parse/testdata/if_expr/fail_top_level_if.carbon index cd9beb834217..49f52823761b 100644 --- a/toolchain/parse/testdata/if_expr/fail_top_level_if.carbon +++ b/toolchain/parse/testdata/if_expr/fail_top_level_if.carbon @@ -9,17 +9,18 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_top_level_if.carbon fn F() { - // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+11]]:6: error: expected `(` after `if` [ExpectedParenAfter] + // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+12]]:6: error: expected `(` after `if` [ExpectedParenAfter] // CHECK:STDERR: if true then 1 else 2; // CHECK:STDERR: ^~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+7]]:11: error: expected braced code block [ExpectedCodeBlock] + // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+8]]:11: error: expected braced code block [ExpectedCodeBlock] // CHECK:STDERR: if true then 1 else 2; // CHECK:STDERR: ^~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+3]]:11: error: expected expression [ExpectedExpr] + // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+4]]:11: error: expected expression [ExpectedExpr] // CHECK:STDERR: if true then 1 else 2; // CHECK:STDERR: ^~~~ + // CHECK:STDERR: if true then 1 else 2; } diff --git a/toolchain/parse/testdata/index/fail_empty_expr.carbon b/toolchain/parse/testdata/index/fail_empty_expr.carbon index e1909fb92450..078aa273076e 100644 --- a/toolchain/parse/testdata/index/fail_empty_expr.carbon +++ b/toolchain/parse/testdata/index/fail_empty_expr.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/index/fail_empty_expr.carbon -// CHECK:STDERR: fail_empty_expr.carbon:[[@LINE+3]]:16: error: expected expression [ExpectedExpr] +// CHECK:STDERR: fail_empty_expr.carbon:[[@LINE+4]]:16: error: expected expression [ExpectedExpr] // CHECK:STDERR: var v: i32 = t[]; // CHECK:STDERR: ^ +// CHECK:STDERR: var v: i32 = t[]; // CHECK:STDOUT: - filename: fail_empty_expr.carbon diff --git a/toolchain/parse/testdata/index/fail_malformed_expr.carbon b/toolchain/parse/testdata/index/fail_malformed_expr.carbon index c836fba8e90d..98fd497708bb 100644 --- a/toolchain/parse/testdata/index/fail_malformed_expr.carbon +++ b/toolchain/parse/testdata/index/fail_malformed_expr.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/index/fail_malformed_expr.carbon -// CHECK:STDERR: fail_malformed_expr.carbon:[[@LINE+3]]:17: error: unexpected tokens before `]` [ExpectedCloseSymbol] +// CHECK:STDERR: fail_malformed_expr.carbon:[[@LINE+4]]:17: error: unexpected tokens before `]` [ExpectedCloseSymbol] // CHECK:STDERR: var v: i32 = t[0,]; // CHECK:STDERR: ^ +// CHECK:STDERR: var v: i32 = t[0,]; // CHECK:STDOUT: - filename: fail_malformed_expr.carbon diff --git a/toolchain/parse/testdata/let/fail_bad_name.carbon b/toolchain/parse/testdata/let/fail_bad_name.carbon index 57c15c630624..440be4142d80 100644 --- a/toolchain/parse/testdata/let/fail_bad_name.carbon +++ b/toolchain/parse/testdata/let/fail_bad_name.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/let/fail_bad_name.carbon -// CHECK:STDERR: fail_bad_name.carbon:[[@LINE+3]]:5: error: expected name in binding pattern [ExpectedBindingPattern] +// CHECK:STDERR: fail_bad_name.carbon:[[@LINE+4]]:5: error: expected name in binding pattern [ExpectedBindingPattern] // CHECK:STDERR: let ? = 4; // CHECK:STDERR: ^ +// CHECK:STDERR: let ? = 4; // CHECK:STDOUT: - filename: fail_bad_name.carbon diff --git a/toolchain/parse/testdata/let/fail_empty.carbon b/toolchain/parse/testdata/let/fail_empty.carbon index 1a22b484bdfb..68a24f6842e8 100644 --- a/toolchain/parse/testdata/let/fail_empty.carbon +++ b/toolchain/parse/testdata/let/fail_empty.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/let/fail_empty.carbon -// CHECK:STDERR: fail_empty.carbon:[[@LINE+3]]:4: error: expected name in binding pattern [ExpectedBindingPattern] +// CHECK:STDERR: fail_empty.carbon:[[@LINE+4]]:4: error: expected name in binding pattern [ExpectedBindingPattern] // CHECK:STDERR: let; // CHECK:STDERR: ^ +// CHECK:STDERR: let; // CHECK:STDOUT: - filename: fail_empty.carbon diff --git a/toolchain/parse/testdata/let/fail_missing_name.carbon b/toolchain/parse/testdata/let/fail_missing_name.carbon index a36e9f8d9ecf..54981a6a35e5 100644 --- a/toolchain/parse/testdata/let/fail_missing_name.carbon +++ b/toolchain/parse/testdata/let/fail_missing_name.carbon @@ -18,9 +18,10 @@ let : i32 = 4; // --- fail_complietime_binding.carbon -// CHECK:STDERR: fail_complietime_binding.carbon:[[@LINE+3]]:5: error: expected name in binding pattern [ExpectedBindingPattern] +// CHECK:STDERR: fail_complietime_binding.carbon:[[@LINE+4]]:5: error: expected name in binding pattern [ExpectedBindingPattern] // CHECK:STDERR: let :! bool = true; // CHECK:STDERR: ^~ +// CHECK:STDERR: let :! bool = true; // CHECK:STDOUT: - filename: fail_runtime_binding.carbon diff --git a/toolchain/parse/testdata/let/fail_missing_type.carbon b/toolchain/parse/testdata/let/fail_missing_type.carbon index 0ddc3e70de98..442d9b3c04a0 100644 --- a/toolchain/parse/testdata/let/fail_missing_type.carbon +++ b/toolchain/parse/testdata/let/fail_missing_type.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/let/fail_missing_type.carbon -// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+3]]:7: error: expected `:` or `:!` in binding pattern [ExpectedBindingPattern] +// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+4]]:7: error: expected `:` or `:!` in binding pattern [ExpectedBindingPattern] // CHECK:STDERR: let a = 4; // CHECK:STDERR: ^ +// CHECK:STDERR: let a = 4; // CHECK:STDOUT: - filename: fail_missing_type.carbon diff --git a/toolchain/parse/testdata/let/fail_no_semi.carbon b/toolchain/parse/testdata/let/fail_no_semi.carbon index 11e326392439..ecc6bd8ab564 100644 --- a/toolchain/parse/testdata/let/fail_no_semi.carbon +++ b/toolchain/parse/testdata/let/fail_no_semi.carbon @@ -10,13 +10,14 @@ let -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+16]]:21: error: expected name in binding pattern [ExpectedBindingPattern] +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+17]]:21: error: expected name in binding pattern [ExpectedBindingPattern] // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+12]]:21: error: `let` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+13]]:21: error: `let` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_no_semi.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, diff --git a/toolchain/parse/testdata/match/fail_cases_after_default.carbon b/toolchain/parse/testdata/match/fail_cases_after_default.carbon index 6a2608ee12e1..b445bc2822ec 100644 --- a/toolchain/parse/testdata/match/fail_cases_after_default.carbon +++ b/toolchain/parse/testdata/match/fail_cases_after_default.carbon @@ -22,9 +22,10 @@ fn f() -> i32 { // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default => { return 3; } - // CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+3]]:5: error: unreachable case; `case` occurs after the `default` [UnreachableMatchCase] + // CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+4]]:5: error: unreachable case; `case` occurs after the `default` [UnreachableMatchCase] // CHECK:STDERR: case (a: i32) if (a == 4) => { return 4; } // CHECK:STDERR: ^~~~ + // CHECK:STDERR: case (a: i32) if (a == 4) => { return 4; } } return 0; diff --git a/toolchain/parse/testdata/match/fail_missing_case_arrow.carbon b/toolchain/parse/testdata/match/fail_missing_case_arrow.carbon index 6174b2d639e6..7e7e931771c0 100644 --- a/toolchain/parse/testdata/match/fail_missing_case_arrow.carbon +++ b/toolchain/parse/testdata/match/fail_missing_case_arrow.carbon @@ -15,9 +15,10 @@ fn f() -> i32 { // CHECK:STDERR: ^ // CHECK:STDERR: case x: i32 { return 2; } - // CHECK:STDERR: fail_missing_case_arrow.carbon:[[@LINE+3]]:29: error: expected `=>` introducing statement block [ExpectedMatchCaseArrow] + // CHECK:STDERR: fail_missing_case_arrow.carbon:[[@LINE+4]]:29: error: expected `=>` introducing statement block [ExpectedMatchCaseArrow] // CHECK:STDERR: case x: i32 if (x == 3) { return 3; } // CHECK:STDERR: ^ + // CHECK:STDERR: case x: i32 if (x == 3) { return 3; } } return 0; diff --git a/toolchain/parse/testdata/match/fail_missing_case_pattern.carbon b/toolchain/parse/testdata/match/fail_missing_case_pattern.carbon index d3334027b73a..754b9ddb42a7 100644 --- a/toolchain/parse/testdata/match/fail_missing_case_pattern.carbon +++ b/toolchain/parse/testdata/match/fail_missing_case_pattern.carbon @@ -10,9 +10,10 @@ fn f() -> i32 { match (3) { - // CHECK:STDERR: fail_missing_case_pattern.carbon:[[@LINE+3]]:10: error: expected name in binding pattern [ExpectedBindingPattern] + // CHECK:STDERR: fail_missing_case_pattern.carbon:[[@LINE+4]]:10: error: expected name in binding pattern [ExpectedBindingPattern] // CHECK:STDERR: case => { return 2; } // CHECK:STDERR: ^~ + // CHECK:STDERR: case => { return 2; } } return 0; diff --git a/toolchain/parse/testdata/match/fail_missing_case_statements_block.carbon b/toolchain/parse/testdata/match/fail_missing_case_statements_block.carbon index b42b414513b0..f61caca4a2c7 100644 --- a/toolchain/parse/testdata/match/fail_missing_case_statements_block.carbon +++ b/toolchain/parse/testdata/match/fail_missing_case_statements_block.carbon @@ -11,9 +11,10 @@ fn f() -> i32 { match (3) { case x: i32 => - // CHECK:STDERR: fail_missing_case_statements_block.carbon:[[@LINE+3]]:5: error: expected `{` after `=>` [ExpectedMatchCaseBlock] + // CHECK:STDERR: fail_missing_case_statements_block.carbon:[[@LINE+4]]:5: error: expected `{` after `=>` [ExpectedMatchCaseBlock] // CHECK:STDERR: default => { return 3; } // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: default => { return 3; } } return 0; diff --git a/toolchain/parse/testdata/match/fail_missing_cases.carbon b/toolchain/parse/testdata/match/fail_missing_cases.carbon index aeb9f1a4b77b..65439a0e1233 100644 --- a/toolchain/parse/testdata/match/fail_missing_cases.carbon +++ b/toolchain/parse/testdata/match/fail_missing_cases.carbon @@ -10,9 +10,10 @@ fn f() -> i32 { - // CHECK:STDERR: fail_missing_cases.carbon:[[@LINE+3]]:14: error: expected cases [ExpectedMatchCases] + // CHECK:STDERR: fail_missing_cases.carbon:[[@LINE+4]]:14: error: expected cases [ExpectedMatchCases] // CHECK:STDERR: match (3) {} // CHECK:STDERR: ^ + // CHECK:STDERR: match (3) {} return 0; } diff --git a/toolchain/parse/testdata/match/fail_missing_cases_block.carbon b/toolchain/parse/testdata/match/fail_missing_cases_block.carbon index 8747c189be6f..ed93173a2d16 100644 --- a/toolchain/parse/testdata/match/fail_missing_cases_block.carbon +++ b/toolchain/parse/testdata/match/fail_missing_cases_block.carbon @@ -10,9 +10,10 @@ fn f() -> i32 { match (1) - // CHECK:STDERR: fail_missing_cases_block.carbon:[[@LINE+3]]:3: error: expected `{` starting block with cases [ExpectedMatchCasesBlock] + // CHECK:STDERR: fail_missing_cases_block.carbon:[[@LINE+4]]:3: error: expected `{` starting block with cases [ExpectedMatchCasesBlock] // CHECK:STDERR: return 0; // CHECK:STDERR: ^~~~~~ + // CHECK:STDERR: return 0; } diff --git a/toolchain/parse/testdata/match/fail_missing_default_arrow.carbon b/toolchain/parse/testdata/match/fail_missing_default_arrow.carbon index baca9f9374ec..c36dc731d80e 100644 --- a/toolchain/parse/testdata/match/fail_missing_default_arrow.carbon +++ b/toolchain/parse/testdata/match/fail_missing_default_arrow.carbon @@ -10,9 +10,10 @@ fn f() -> i32 { match (3) { - // CHECK:STDERR: fail_missing_default_arrow.carbon:[[@LINE+3]]:13: error: expected `=>` introducing statement block [ExpectedMatchCaseArrow] + // CHECK:STDERR: fail_missing_default_arrow.carbon:[[@LINE+4]]:13: error: expected `=>` introducing statement block [ExpectedMatchCaseArrow] // CHECK:STDERR: default { return 1; } // CHECK:STDERR: ^ + // CHECK:STDERR: default { return 1; } } return 0; diff --git a/toolchain/parse/testdata/match/fail_missing_default_statements_block.carbon b/toolchain/parse/testdata/match/fail_missing_default_statements_block.carbon index 0b89e5865fcc..b75e58f2d583 100644 --- a/toolchain/parse/testdata/match/fail_missing_default_statements_block.carbon +++ b/toolchain/parse/testdata/match/fail_missing_default_statements_block.carbon @@ -11,9 +11,10 @@ fn f() -> i32 { match (3) { default => - // CHECK:STDERR: fail_missing_default_statements_block.carbon:[[@LINE+3]]:3: error: expected `{` after `=>` [ExpectedMatchCaseBlock] + // CHECK:STDERR: fail_missing_default_statements_block.carbon:[[@LINE+4]]:3: error: expected `{` after `=>` [ExpectedMatchCaseBlock] // CHECK:STDERR: } // CHECK:STDERR: ^ + // CHECK:STDERR: } return 0; } diff --git a/toolchain/parse/testdata/match/fail_missing_guard_close_paren.carbon b/toolchain/parse/testdata/match/fail_missing_guard_close_paren.carbon index bd825b501626..6ffedb2f0d14 100644 --- a/toolchain/parse/testdata/match/fail_missing_guard_close_paren.carbon +++ b/toolchain/parse/testdata/match/fail_missing_guard_close_paren.carbon @@ -10,13 +10,14 @@ fn f() -> i32 { match (true) { - // CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+7]]:21: error: opening symbol without a corresponding closing symbol [UnmatchedOpening] + // CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+8]]:21: error: opening symbol without a corresponding closing symbol [UnmatchedOpening] // CHECK:STDERR: case x: bool if (false => { return 1; } // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+3]]:28: error: TODO: improve match parsing [MatchParseTODO] + // CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+4]]:28: error: TODO: improve match parsing [MatchParseTODO] // CHECK:STDERR: case x: bool if (false => { return 1; } // CHECK:STDERR: ^~ + // CHECK:STDERR: case x: bool if (false => { return 1; } } return 0; diff --git a/toolchain/parse/testdata/match/fail_missing_guard_open_paren.carbon b/toolchain/parse/testdata/match/fail_missing_guard_open_paren.carbon index a6cb6cd1e497..4d5860adf4f0 100644 --- a/toolchain/parse/testdata/match/fail_missing_guard_open_paren.carbon +++ b/toolchain/parse/testdata/match/fail_missing_guard_open_paren.carbon @@ -10,13 +10,14 @@ fn f() -> i32 { match (true) { - // CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+7]]:21: error: TODO: improve match parsing [MatchParseTODO] + // CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+8]]:21: error: TODO: improve match parsing [MatchParseTODO] // CHECK:STDERR: case x: bool if false) => { return 1; } // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+3]]:26: error: closing symbol without a corresponding opening symbol [UnmatchedClosing] + // CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+4]]:26: error: closing symbol without a corresponding opening symbol [UnmatchedClosing] // CHECK:STDERR: case x: bool if false) => { return 1; } // CHECK:STDERR: ^ + // CHECK:STDERR: case x: bool if false) => { return 1; } } return 0; diff --git a/toolchain/parse/testdata/match/fail_missing_matched_expr.carbon b/toolchain/parse/testdata/match/fail_missing_matched_expr.carbon index 36e72b668dcb..579c7a7ca097 100644 --- a/toolchain/parse/testdata/match/fail_missing_matched_expr.carbon +++ b/toolchain/parse/testdata/match/fail_missing_matched_expr.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/match/fail_missing_matched_expr.carbon fn f() -> i32 { - // CHECK:STDERR: fail_missing_matched_expr.carbon:[[@LINE+3]]:9: error: expected `(` after `match` [ExpectedParenAfter] + // CHECK:STDERR: fail_missing_matched_expr.carbon:[[@LINE+4]]:9: error: expected `(` after `match` [ExpectedParenAfter] // CHECK:STDERR: match { // CHECK:STDERR: ^ + // CHECK:STDERR: match { default => { return 1; } } diff --git a/toolchain/parse/testdata/match/fail_unexpected_tokens_in_cases_block.carbon b/toolchain/parse/testdata/match/fail_unexpected_tokens_in_cases_block.carbon index 48092b57db80..5a223b88248f 100644 --- a/toolchain/parse/testdata/match/fail_unexpected_tokens_in_cases_block.carbon +++ b/toolchain/parse/testdata/match/fail_unexpected_tokens_in_cases_block.carbon @@ -43,9 +43,10 @@ fn f() -> i32 { // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: return 1; - // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+3]]:5: error: unexpected `(`; expected `case`, `default` or `}` [UnexpectedTokenInMatchCasesBlock] + // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `(`; expected `case`, `default` or `}` [UnexpectedTokenInMatchCasesBlock] // CHECK:STDERR: ((), (), ()) // CHECK:STDERR: ^ + // CHECK:STDERR: ((), (), ()) } return 0; diff --git a/toolchain/parse/testdata/member_access/fail_keyword.carbon b/toolchain/parse/testdata/member_access/fail_keyword.carbon index b63e202d603b..63b1b43db45b 100644 --- a/toolchain/parse/testdata/member_access/fail_keyword.carbon +++ b/toolchain/parse/testdata/member_access/fail_keyword.carbon @@ -34,9 +34,10 @@ fn F() { // CHECK:STDERR: ^~~~ // CHECK:STDERR: p->Self; - // CHECK:STDERR: fail_keyword.carbon:[[@LINE+3]]:6: error: expected identifier after `->` [ExpectedIdentifierAfterPeriodOrArrow] + // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:6: error: expected identifier after `->` [ExpectedIdentifierAfterPeriodOrArrow] // CHECK:STDERR: p->while; // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: p->while; } diff --git a/toolchain/parse/testdata/namespace/fail_arrow.carbon b/toolchain/parse/testdata/namespace/fail_arrow.carbon index a3aff1f15877..af859372653c 100644 --- a/toolchain/parse/testdata/namespace/fail_arrow.carbon +++ b/toolchain/parse/testdata/namespace/fail_arrow.carbon @@ -10,9 +10,10 @@ namespace Foo; -// CHECK:STDERR: fail_arrow.carbon:[[@LINE+3]]:10: error: `class` declarations must either end with a `;` or have a `{ ... }` block for a definition [ExpectedDeclSemiOrDefinition] +// CHECK:STDERR: fail_arrow.carbon:[[@LINE+4]]:10: error: `class` declarations must either end with a `;` or have a `{ ... }` block for a definition [ExpectedDeclSemiOrDefinition] // CHECK:STDERR: class Foo->Bar {} // CHECK:STDERR: ^~ +// CHECK:STDERR: class Foo->Bar {} // CHECK:STDOUT: - filename: fail_arrow.carbon diff --git a/toolchain/parse/testdata/namespace/fail_incomplete.carbon b/toolchain/parse/testdata/namespace/fail_incomplete.carbon index c7e8061c386a..3fc65854e5e3 100644 --- a/toolchain/parse/testdata/namespace/fail_incomplete.carbon +++ b/toolchain/parse/testdata/namespace/fail_incomplete.carbon @@ -38,9 +38,10 @@ namespace bool // CHECK:STDERR: namespace namespace namespace namespace namespace -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: error: `namespace` introducer should be followed by a name [ExpectedDeclName] +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:1: error: `namespace` introducer should be followed by a name [ExpectedDeclName] // CHECK:STDERR: namespace // CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: namespace // CHECK:STDOUT: - filename: fail_incomplete.carbon diff --git a/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon b/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon index 3452e3b82964..bb1be72e9a3b 100644 --- a/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon +++ b/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/namespace/fail_incomplete_name.carbon -// CHECK:STDERR: fail_incomplete_name.carbon:[[@LINE+3]]:15: error: `.` should be followed by a name [ExpectedDeclNameAfterPeriod] +// CHECK:STDERR: fail_incomplete_name.carbon:[[@LINE+4]]:15: error: `.` should be followed by a name [ExpectedDeclNameAfterPeriod] // CHECK:STDERR: namespace Foo.; // CHECK:STDERR: ^ +// CHECK:STDERR: namespace Foo.; // CHECK:STDOUT: - filename: fail_incomplete_name.carbon diff --git a/toolchain/parse/testdata/namespace/fail_modifiers.carbon b/toolchain/parse/testdata/namespace/fail_modifiers.carbon index bf98b7cbb16a..dbb81cd95ceb 100644 --- a/toolchain/parse/testdata/namespace/fail_modifiers.carbon +++ b/toolchain/parse/testdata/namespace/fail_modifiers.carbon @@ -10,13 +10,14 @@ virtual namespace B -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:1: error: `namespace` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+8]]:1: error: `namespace` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: impl namespace // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:6: error: `namespace` introducer should be followed by a name [ExpectedDeclName] +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:6: error: `namespace` introducer should be followed by a name [ExpectedDeclName] // CHECK:STDERR: impl namespace // CHECK:STDERR: ^~~~~~~~~ +// CHECK:STDERR: impl namespace // CHECK:STDOUT: - filename: fail_modifiers.carbon diff --git a/toolchain/parse/testdata/namespace/fail_no_name.carbon b/toolchain/parse/testdata/namespace/fail_no_name.carbon index bc83b0649962..53cd52a63818 100644 --- a/toolchain/parse/testdata/namespace/fail_no_name.carbon +++ b/toolchain/parse/testdata/namespace/fail_no_name.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/namespace/fail_no_name.carbon -// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:10: error: `namespace` introducer should be followed by a name [ExpectedDeclName] +// CHECK:STDERR: fail_no_name.carbon:[[@LINE+4]]:10: error: `namespace` introducer should be followed by a name [ExpectedDeclName] // CHECK:STDERR: namespace; // CHECK:STDERR: ^ +// CHECK:STDERR: namespace; // CHECK:STDOUT: - filename: fail_no_name.carbon diff --git a/toolchain/parse/testdata/operators/fail_chained_assign.carbon b/toolchain/parse/testdata/operators/fail_chained_assign.carbon index 337c13bae94f..686610010b1d 100644 --- a/toolchain/parse/testdata/operators/fail_chained_assign.carbon +++ b/toolchain/parse/testdata/operators/fail_chained_assign.carbon @@ -13,9 +13,10 @@ fn F() { var b: i32; // TODO: Produce a custom diagnostic for this. - // CHECK:STDERR: fail_chained_assign.carbon:[[@LINE+3]]:9: error: operator `=` can only be used as a complete statement [StatementOperatorAsSubExpr] + // CHECK:STDERR: fail_chained_assign.carbon:[[@LINE+4]]:9: error: operator `=` can only be used as a complete statement [StatementOperatorAsSubExpr] // CHECK:STDERR: a = b = 1; // CHECK:STDERR: ^ + // CHECK:STDERR: a = b = 1; } diff --git a/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon b/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon index 5cb2b278ea2c..598d4baa2cff 100644 --- a/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon +++ b/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon @@ -10,9 +10,10 @@ // TODO: We could figure out that this first Failed example is infix // with one-token lookahead. -// CHECK:STDERR: fail_infix_uneven_space_after.carbon:[[@LINE+3]]:16: error: `var` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_infix_uneven_space_after.carbon:[[@LINE+4]]:16: error: `var` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: var n: i8 = n* n; // CHECK:STDERR: ^ +// CHECK:STDERR: var n: i8 = n* n; // CHECK:STDOUT: - filename: fail_infix_uneven_space_after.carbon diff --git a/toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon b/toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon index 669bead76cf1..f9f9c47e5209 100644 --- a/toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon +++ b/toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon -// CHECK:STDERR: fail_infix_uneven_space_before.carbon:[[@LINE+3]]:15: error: whitespace missing after binary operator [BinaryOperatorRequiresWhitespace] +// CHECK:STDERR: fail_infix_uneven_space_before.carbon:[[@LINE+4]]:15: error: whitespace missing after binary operator [BinaryOperatorRequiresWhitespace] // CHECK:STDERR: var n: i8 = n *n; // CHECK:STDERR: ^ +// CHECK:STDERR: var n: i8 = n *n; // CHECK:STDOUT: - filename: fail_infix_uneven_space_before.carbon diff --git a/toolchain/parse/testdata/operators/fail_invalid_infix.carbon b/toolchain/parse/testdata/operators/fail_invalid_infix.carbon index 942eda0ed7c3..95dde4372c65 100644 --- a/toolchain/parse/testdata/operators/fail_invalid_infix.carbon +++ b/toolchain/parse/testdata/operators/fail_invalid_infix.carbon @@ -18,13 +18,14 @@ var a: i32 = n == ; // CHECK:STDERR: ^~ // CHECK:STDERR: var b: i32 = == n; -// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+7]]:14: error: expected expression [ExpectedExpr] +// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+8]]:14: error: expected expression [ExpectedExpr] // CHECK:STDERR: var c: i32 = == ; // CHECK:STDERR: ^~ // CHECK:STDERR: -// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+3]]:17: error: expected expression [ExpectedExpr] +// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+4]]:17: error: expected expression [ExpectedExpr] // CHECK:STDERR: var c: i32 = == ; // CHECK:STDERR: ^ +// CHECK:STDERR: var c: i32 = == ; // CHECK:STDOUT: - filename: fail_invalid_infix.carbon diff --git a/toolchain/parse/testdata/operators/fail_postfix_space.carbon b/toolchain/parse/testdata/operators/fail_postfix_space.carbon index 71046080d7bd..f72e3cd98bed 100644 --- a/toolchain/parse/testdata/operators/fail_postfix_space.carbon +++ b/toolchain/parse/testdata/operators/fail_postfix_space.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space.carbon -// CHECK:STDERR: fail_postfix_space.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator [UnaryOperatorHasWhitespace] +// CHECK:STDERR: fail_postfix_space.carbon:[[@LINE+4]]:18: error: whitespace is not allowed before this unary operator [UnaryOperatorHasWhitespace] // CHECK:STDERR: var v: type = i8 *; // CHECK:STDERR: ^ +// CHECK:STDERR: var v: type = i8 *; // CHECK:STDOUT: - filename: fail_postfix_space.carbon diff --git a/toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon b/toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon index 030843046628..4f1335dd223c 100644 --- a/toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon +++ b/toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon -// CHECK:STDERR: fail_postfix_space_before_comma.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator [UnaryOperatorHasWhitespace] +// CHECK:STDERR: fail_postfix_space_before_comma.carbon:[[@LINE+4]]:18: error: whitespace is not allowed before this unary operator [UnaryOperatorHasWhitespace] // CHECK:STDERR: var n: i8 = F(i8 *, 0); // CHECK:STDERR: ^ +// CHECK:STDERR: var n: i8 = F(i8 *, 0); // CHECK:STDOUT: - filename: fail_postfix_space_before_comma.carbon diff --git a/toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon b/toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon index 5a7c5f92ca43..55795ed4037a 100644 --- a/toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon +++ b/toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon -// CHECK:STDERR: fail_postfix_space_in_call.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator [UnaryOperatorHasWhitespace] +// CHECK:STDERR: fail_postfix_space_in_call.carbon:[[@LINE+4]]:18: error: whitespace is not allowed before this unary operator [UnaryOperatorHasWhitespace] // CHECK:STDERR: var n: i8 = F(i8 *); // CHECK:STDERR: ^ +// CHECK:STDERR: var n: i8 = F(i8 *); // CHECK:STDOUT: - filename: fail_postfix_space_in_call.carbon diff --git a/toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon b/toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon index bc13043beac7..3aef579cc28b 100644 --- a/toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon +++ b/toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon -// CHECK:STDERR: fail_postfix_space_surrounding.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator [UnaryOperatorHasWhitespace] +// CHECK:STDERR: fail_postfix_space_surrounding.carbon:[[@LINE+4]]:18: error: whitespace is not allowed before this unary operator [UnaryOperatorHasWhitespace] // CHECK:STDERR: var v: type = i8 * ; // CHECK:STDERR: ^ +// CHECK:STDERR: var v: type = i8 * ; // CHECK:STDOUT: - filename: fail_postfix_space_surrounding.carbon diff --git a/toolchain/parse/testdata/operators/fail_postincrement.carbon b/toolchain/parse/testdata/operators/fail_postincrement.carbon index 5875fe00c30f..6306cb2e6a2a 100644 --- a/toolchain/parse/testdata/operators/fail_postincrement.carbon +++ b/toolchain/parse/testdata/operators/fail_postincrement.carbon @@ -16,9 +16,10 @@ fn F() { // CHECK:STDERR: ^~ // CHECK:STDERR: n++; - // CHECK:STDERR: fail_postincrement.carbon:[[@LINE+3]]:4: error: expected `;` after expression statement [ExpectedExprSemi] + // CHECK:STDERR: fail_postincrement.carbon:[[@LINE+4]]:4: error: expected `;` after expression statement [ExpectedExprSemi] // CHECK:STDERR: n--; // CHECK:STDERR: ^~ + // CHECK:STDERR: n--; } diff --git a/toolchain/parse/testdata/operators/fail_precedence_and_or.carbon b/toolchain/parse/testdata/operators/fail_precedence_and_or.carbon index 2c4224797e4c..a783c3566eda 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_and_or.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_and_or.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_precedence_and_or.carbon fn F() { - // CHECK:STDERR: fail_precedence_and_or.carbon:[[@LINE+3]]:11: error: parentheses are required to disambiguate operator precedence [OperatorRequiresParentheses] + // CHECK:STDERR: fail_precedence_and_or.carbon:[[@LINE+4]]:11: error: parentheses are required to disambiguate operator precedence [OperatorRequiresParentheses] // CHECK:STDERR: a and b or c; // CHECK:STDERR: ^~ + // CHECK:STDERR: a and b or c; } diff --git a/toolchain/parse/testdata/operators/fail_precedence_as.carbon b/toolchain/parse/testdata/operators/fail_precedence_as.carbon index 3abb252b912e..7f3ca4ab5f05 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_as.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_as.carbon @@ -46,9 +46,10 @@ fn F(n: i32) { // CHECK:STDERR: ^~ // CHECK:STDERR: 6 as i32 == 7; - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+3]]:10: error: parentheses are required to disambiguate operator precedence [OperatorRequiresParentheses] + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:10: error: parentheses are required to disambiguate operator precedence [OperatorRequiresParentheses] // CHECK:STDERR: 8 <= 9 as i32; // CHECK:STDERR: ^~ + // CHECK:STDERR: 8 <= 9 as i32; } diff --git a/toolchain/parse/testdata/operators/fail_precedence_assign.carbon b/toolchain/parse/testdata/operators/fail_precedence_assign.carbon index d73dd45b0995..c4bf63f66f86 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_assign.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_assign.carbon @@ -31,9 +31,10 @@ fn F() { // CHECK:STDERR: ^~ // CHECK:STDERR: a + ++a; - // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+3]]:5: error: parentheses are required around this unary `if` operator [UnaryOperatorRequiresParentheses] + // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:5: error: parentheses are required around this unary `if` operator [UnaryOperatorRequiresParentheses] // CHECK:STDERR: ++if c then a else b; // CHECK:STDERR: ^~ + // CHECK:STDERR: ++if c then a else b; } diff --git a/toolchain/parse/testdata/operators/fail_precedence_or_and.carbon b/toolchain/parse/testdata/operators/fail_precedence_or_and.carbon index 095319edadfc..1667de02841f 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_or_and.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_or_and.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_precedence_or_and.carbon fn F() { - // CHECK:STDERR: fail_precedence_or_and.carbon:[[@LINE+3]]:10: error: parentheses are required to disambiguate operator precedence [OperatorRequiresParentheses] + // CHECK:STDERR: fail_precedence_or_and.carbon:[[@LINE+4]]:10: error: parentheses are required to disambiguate operator precedence [OperatorRequiresParentheses] // CHECK:STDERR: a or b and c; // CHECK:STDERR: ^~~ + // CHECK:STDERR: a or b and c; } diff --git a/toolchain/parse/testdata/operators/fail_precedence_where.carbon b/toolchain/parse/testdata/operators/fail_precedence_where.carbon index 2afd40072688..8c6cffe14606 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_where.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_where.carbon @@ -91,9 +91,10 @@ fn AsInArgument() { // --- fail_greater_in_argument.carbon fn GreaterInArgument() { - // CHECK:STDERR: fail_greater_in_argument.carbon:[[@LINE+3]]:15: error: requirement should use `impls`, `=`, or `==` operator [ExpectedRequirementOperator] + // CHECK:STDERR: fail_greater_in_argument.carbon:[[@LINE+4]]:15: error: requirement should use `impls`, `=`, or `==` operator [ExpectedRequirementOperator] // CHECK:STDERR: Q where .AA > .BB impls CC; // CHECK:STDERR: ^ + // CHECK:STDERR: Q where .AA > .BB impls CC; } diff --git a/toolchain/parse/testdata/operators/fail_prefix_repeat.carbon b/toolchain/parse/testdata/operators/fail_prefix_repeat.carbon index 653dc79f3cbf..4e5f09b5f623 100644 --- a/toolchain/parse/testdata/operators/fail_prefix_repeat.carbon +++ b/toolchain/parse/testdata/operators/fail_prefix_repeat.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_prefix_repeat.carbon -// CHECK:STDERR: fail_prefix_repeat.carbon:[[@LINE+3]]:17: error: parentheses are required around this unary `const` operator [UnaryOperatorRequiresParentheses] +// CHECK:STDERR: fail_prefix_repeat.carbon:[[@LINE+4]]:17: error: parentheses are required around this unary `const` operator [UnaryOperatorRequiresParentheses] // CHECK:STDERR: fn F() -> const const i32* { // CHECK:STDERR: ^~~~~ +// CHECK:STDERR: fn F() -> const const i32* { } diff --git a/toolchain/parse/testdata/operators/fail_prefix_space.carbon b/toolchain/parse/testdata/operators/fail_prefix_space.carbon index e3a0a5a67b08..df51e4b3c0c2 100644 --- a/toolchain/parse/testdata/operators/fail_prefix_space.carbon +++ b/toolchain/parse/testdata/operators/fail_prefix_space.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_prefix_space.carbon -// CHECK:STDERR: fail_prefix_space.carbon:[[@LINE+3]]:13: error: whitespace is not allowed after this unary operator [UnaryOperatorHasWhitespace] +// CHECK:STDERR: fail_prefix_space.carbon:[[@LINE+4]]:13: error: whitespace is not allowed after this unary operator [UnaryOperatorHasWhitespace] // CHECK:STDERR: var n: i8 = - n; // CHECK:STDERR: ^ +// CHECK:STDERR: var n: i8 = - n; // CHECK:STDOUT: - filename: fail_prefix_space.carbon diff --git a/toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon b/toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon index 7076c713174f..c1cbd92c8d95 100644 --- a/toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon +++ b/toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon -// CHECK:STDERR: fail_prefix_uneven_space_with_assign.carbon:[[@LINE+3]]:12: error: whitespace is not allowed after this unary operator [UnaryOperatorHasWhitespace] +// CHECK:STDERR: fail_prefix_uneven_space_with_assign.carbon:[[@LINE+4]]:12: error: whitespace is not allowed after this unary operator [UnaryOperatorHasWhitespace] // CHECK:STDERR: var n: i8 =- n; // CHECK:STDERR: ^ +// CHECK:STDERR: var n: i8 =- n; // CHECK:STDOUT: - filename: fail_prefix_uneven_space_with_assign.carbon diff --git a/toolchain/parse/testdata/operators/fail_star_minus.carbon b/toolchain/parse/testdata/operators/fail_star_minus.carbon index 86af91da378c..32f9fbe0f3ce 100644 --- a/toolchain/parse/testdata/operators/fail_star_minus.carbon +++ b/toolchain/parse/testdata/operators/fail_star_minus.carbon @@ -13,9 +13,10 @@ // available because it has already accepted that first part of the expression, // so it is recovering by using the second option, but the diagnostic should // ideally offer (or consider) both fixes as alternatives. -// CHECK:STDERR: fail_star_minus.carbon:[[@LINE+3]]:16: error: whitespace missing after binary operator [BinaryOperatorRequiresWhitespace] +// CHECK:STDERR: fail_star_minus.carbon:[[@LINE+4]]:16: error: whitespace missing after binary operator [BinaryOperatorRequiresWhitespace] // CHECK:STDERR: var n: i8 = n* -n; // CHECK:STDERR: ^ +// CHECK:STDERR: var n: i8 = n* -n; // CHECK:STDOUT: - filename: fail_star_minus.carbon diff --git a/toolchain/parse/testdata/operators/fail_star_star.carbon b/toolchain/parse/testdata/operators/fail_star_star.carbon index 1b63a5b51033..df3cdf61c0a9 100644 --- a/toolchain/parse/testdata/operators/fail_star_star.carbon +++ b/toolchain/parse/testdata/operators/fail_star_star.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_star_star.carbon -// CHECK:STDERR: fail_star_star.carbon:[[@LINE+3]]:16: error: whitespace missing after binary operator [BinaryOperatorRequiresWhitespace] +// CHECK:STDERR: fail_star_star.carbon:[[@LINE+4]]:16: error: whitespace missing after binary operator [BinaryOperatorRequiresWhitespace] // CHECK:STDERR: var n: i8 = n* *p; // CHECK:STDERR: ^ +// CHECK:STDERR: var n: i8 = n* *p; // CHECK:STDOUT: - filename: fail_star_star.carbon diff --git a/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon b/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon index 38e4e3531249..8767552136f2 100644 --- a/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon +++ b/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon @@ -12,9 +12,10 @@ // before we notice the missing whitespace around the second `*`. // It'd be better to (somehow) form n*(*p) and reject due to the missing // whitespace around the first `*`. -// CHECK:STDERR: fail_star_star_no_space.carbon:[[@LINE+3]]:16: error: `var` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_star_star_no_space.carbon:[[@LINE+4]]:16: error: `var` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: var n: i8 = n**p; // CHECK:STDERR: ^ +// CHECK:STDERR: var n: i8 = n**p; // CHECK:STDOUT: - filename: fail_star_star_no_space.carbon diff --git a/toolchain/parse/testdata/operators/fail_variety.carbon b/toolchain/parse/testdata/operators/fail_variety.carbon index 212fcdffc3c1..827d95c61340 100644 --- a/toolchain/parse/testdata/operators/fail_variety.carbon +++ b/toolchain/parse/testdata/operators/fail_variety.carbon @@ -9,25 +9,26 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_variety.carbon fn F() { - // CHECK:STDERR: fail_variety.carbon:[[@LINE+19]]:21: error: operator `=` can only be used as a complete statement [StatementOperatorAsSubExpr] + // CHECK:STDERR: fail_variety.carbon:[[@LINE+20]]:21: error: operator `=` can only be used as a complete statement [StatementOperatorAsSubExpr] // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_variety.carbon:[[@LINE+15]]:29: error: parentheses are required to disambiguate operator precedence [OperatorRequiresParentheses] + // CHECK:STDERR: fail_variety.carbon:[[@LINE+16]]:29: error: parentheses are required to disambiguate operator precedence [OperatorRequiresParentheses] // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^~ // CHECK:STDERR: - // CHECK:STDERR: fail_variety.carbon:[[@LINE+11]]:34: error: parentheses are required to disambiguate operator precedence [OperatorRequiresParentheses] + // CHECK:STDERR: fail_variety.carbon:[[@LINE+12]]:34: error: parentheses are required to disambiguate operator precedence [OperatorRequiresParentheses] // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_variety.carbon:[[@LINE+7]]:38: error: parentheses are required to disambiguate operator precedence [OperatorRequiresParentheses] + // CHECK:STDERR: fail_variety.carbon:[[@LINE+8]]:38: error: parentheses are required to disambiguate operator precedence [OperatorRequiresParentheses] // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_variety.carbon:[[@LINE+3]]:40: error: parentheses are required around this unary `not` operator [UnaryOperatorRequiresParentheses] + // CHECK:STDERR: fail_variety.carbon:[[@LINE+4]]:40: error: parentheses are required around this unary `not` operator [UnaryOperatorRequiresParentheses] // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^~~ + // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; } diff --git a/toolchain/parse/testdata/operators/unary.carbon b/toolchain/parse/testdata/operators/unary.carbon index 1afc41ecab72..e336a4255520 100644 --- a/toolchain/parse/testdata/operators/unary.carbon +++ b/toolchain/parse/testdata/operators/unary.carbon @@ -11,9 +11,10 @@ // --- fail_space_before.carbon fn F() { - // CHECK:STDERR: fail_space_before.carbon:[[@LINE+3]]:16: error: whitespace is required before this unary operator [UnaryOperatorRequiresWhitespace] + // CHECK:STDERR: fail_space_before.carbon:[[@LINE+4]]:16: error: whitespace is required before this unary operator [UnaryOperatorRequiresWhitespace] // CHECK:STDERR: if (false) {}--0; // CHECK:STDERR: ^~ + // CHECK:STDERR: if (false) {}--0; } diff --git a/toolchain/parse/testdata/package_expr/fail_in_name.carbon b/toolchain/parse/testdata/package_expr/fail_in_name.carbon index 4de8e64d9482..d99b4fee38ff 100644 --- a/toolchain/parse/testdata/package_expr/fail_in_name.carbon +++ b/toolchain/parse/testdata/package_expr/fail_in_name.carbon @@ -20,9 +20,10 @@ var package.val: i32; // CHECK:STDERR: namespace package.NS; -// CHECK:STDERR: fail_in_name.carbon:[[@LINE+3]]:7: error: `class` introducer should be followed by a name [ExpectedDeclName] +// CHECK:STDERR: fail_in_name.carbon:[[@LINE+4]]:7: error: `class` introducer should be followed by a name [ExpectedDeclName] // CHECK:STDERR: class package.C { // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: class package.C { } diff --git a/toolchain/parse/testdata/package_expr/fail_standalone.carbon b/toolchain/parse/testdata/package_expr/fail_standalone.carbon index 7fc2de7ed539..41607d3969e7 100644 --- a/toolchain/parse/testdata/package_expr/fail_standalone.carbon +++ b/toolchain/parse/testdata/package_expr/fail_standalone.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/package_expr/fail_standalone.carbon fn F() { - // CHECK:STDERR: fail_standalone.carbon:[[@LINE+3]]:10: error: expected `.` after `package` expression [ExpectedPeriodAfterPackage] + // CHECK:STDERR: fail_standalone.carbon:[[@LINE+4]]:10: error: expected `.` after `package` expression [ExpectedPeriodAfterPackage] // CHECK:STDERR: package; // CHECK:STDERR: ^ + // CHECK:STDERR: package; } diff --git a/toolchain/parse/testdata/packages/export.carbon b/toolchain/parse/testdata/packages/export.carbon index 5eb16eb8f4fe..4afd5791573b 100644 --- a/toolchain/parse/testdata/packages/export.carbon +++ b/toolchain/parse/testdata/packages/export.carbon @@ -129,9 +129,10 @@ export Foo; impl package Pkg; -// CHECK:STDERR: fail_in_impl.carbon:[[@LINE+3]]:1: error: `export` is only allowed in API files [ExportFromImpl] +// CHECK:STDERR: fail_in_impl.carbon:[[@LINE+4]]:1: error: `export` is only allowed in API files [ExportFromImpl] // CHECK:STDERR: export Foo; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: export Foo; // CHECK:STDOUT: - filename: lib.carbon diff --git a/toolchain/parse/testdata/packages/import/export.carbon b/toolchain/parse/testdata/packages/import/export.carbon index e06a226d7b0e..8f368bd6908e 100644 --- a/toolchain/parse/testdata/packages/import/export.carbon +++ b/toolchain/parse/testdata/packages/import/export.carbon @@ -59,9 +59,10 @@ export import library "lib"; impl package Pkg; -// CHECK:STDERR: fail_in_impl.carbon:[[@LINE+3]]:1: error: `export` is only allowed in API files [ExportFromImpl] +// CHECK:STDERR: fail_in_impl.carbon:[[@LINE+4]]:1: error: `export` is only allowed in API files [ExportFromImpl] // CHECK:STDERR: export import library "lib"; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: export import library "lib"; // CHECK:STDOUT: - filename: fail_package.carbon diff --git a/toolchain/parse/testdata/packages/import/fail_after_decl.carbon b/toolchain/parse/testdata/packages/import/fail_after_decl.carbon index 76ca7e85a8ee..771d47295cc7 100644 --- a/toolchain/parse/testdata/packages/import/fail_after_decl.carbon +++ b/toolchain/parse/testdata/packages/import/fail_after_decl.carbon @@ -10,12 +10,13 @@ fn A(); -// CHECK:STDERR: fail_after_decl.carbon:[[@LINE+6]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file [ImportTooLate] +// CHECK:STDERR: fail_after_decl.carbon:[[@LINE+7]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file [ImportTooLate] // CHECK:STDERR: import B; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_after_decl.carbon:[[@LINE-5]]:1: note: first declaration is here [FirstDecl] // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ +// CHECK:STDERR: import B; // CHECK:STDOUT: - filename: fail_after_decl.carbon diff --git a/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon b/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon index f531f0539f2d..98131dc9f2d9 100644 --- a/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon +++ b/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon @@ -32,12 +32,13 @@ package D; fn E(); -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+6]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file [ImportTooLate] +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+7]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file [ImportTooLate] // CHECK:STDERR: import F; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-27]]:1: note: first declaration is here [FirstDecl] // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ +// CHECK:STDERR: import F; // Note this is still invalid, but doesn't warn because it's sequential. import G; diff --git a/toolchain/parse/testdata/packages/import/fail_extra_string.carbon b/toolchain/parse/testdata/packages/import/fail_extra_string.carbon index 6880a5af7511..a7d0a0edb928 100644 --- a/toolchain/parse/testdata/packages/import/fail_extra_string.carbon +++ b/toolchain/parse/testdata/packages/import/fail_extra_string.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_extra_string.carbon -// CHECK:STDERR: fail_extra_string.carbon:[[@LINE+3]]:26: error: `import` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_extra_string.carbon:[[@LINE+4]]:26: error: `import` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: import Foo library "bar" "baz"; // CHECK:STDERR: ^~~~~ +// CHECK:STDERR: import Foo library "bar" "baz"; // CHECK:STDOUT: - filename: fail_extra_string.carbon diff --git a/toolchain/parse/testdata/packages/import/fail_in_nested_scope.carbon b/toolchain/parse/testdata/packages/import/fail_in_nested_scope.carbon index a7900c1bc861..c47f72ef69f0 100644 --- a/toolchain/parse/testdata/packages/import/fail_in_nested_scope.carbon +++ b/toolchain/parse/testdata/packages/import/fail_in_nested_scope.carbon @@ -20,12 +20,13 @@ class A { } fn F() { - // CHECK:STDERR: fail_in_nested_scope.carbon:[[@LINE+6]]:3: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file [ImportTooLate] + // CHECK:STDERR: fail_in_nested_scope.carbon:[[@LINE+7]]:3: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file [ImportTooLate] // CHECK:STDERR: import C; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_in_nested_scope.carbon:[[@LINE-15]]:1: note: first declaration is here [FirstDecl] // CHECK:STDERR: class A { // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: import C; } diff --git a/toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon b/toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon index 5a592ae90c21..78013661d2d0 100644 --- a/toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon +++ b/toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon -// CHECK:STDERR: fail_library_is_identifier.carbon:[[@LINE+3]]:25: error: expected a string literal to specify the library name [ExpectedLibraryName] +// CHECK:STDERR: fail_library_is_identifier.carbon:[[@LINE+4]]:25: error: expected a string literal to specify the library name [ExpectedLibraryName] // CHECK:STDERR: import Geometry library Shapes; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: import Geometry library Shapes; // CHECK:STDOUT: - filename: fail_library_is_identifier.carbon diff --git a/toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon b/toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon index 829bb50baeb7..64191bc6ecb8 100644 --- a/toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon +++ b/toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon -// CHECK:STDERR: fail_name_is_keyword.carbon:[[@LINE+3]]:8: error: expected identifier or `library` after `import` [ExpectedIdentifierAfterImport] +// CHECK:STDERR: fail_name_is_keyword.carbon:[[@LINE+4]]:8: error: expected identifier or `library` after `import` [ExpectedIdentifierAfterImport] // CHECK:STDERR: import fn; // CHECK:STDERR: ^~ +// CHECK:STDERR: import fn; // CHECK:STDOUT: - filename: fail_name_is_keyword.carbon diff --git a/toolchain/parse/testdata/packages/import/fail_no_name.carbon b/toolchain/parse/testdata/packages/import/fail_no_name.carbon index 6b92d2599e45..9a15b78449d1 100644 --- a/toolchain/parse/testdata/packages/import/fail_no_name.carbon +++ b/toolchain/parse/testdata/packages/import/fail_no_name.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_no_name.carbon -// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:7: error: expected identifier or `library` after `import` [ExpectedIdentifierAfterImport] +// CHECK:STDERR: fail_no_name.carbon:[[@LINE+4]]:7: error: expected identifier or `library` after `import` [ExpectedIdentifierAfterImport] // CHECK:STDERR: import; // CHECK:STDERR: ^ +// CHECK:STDERR: import; // CHECK:STDOUT: - filename: fail_no_name.carbon diff --git a/toolchain/parse/testdata/packages/import/fail_no_semi.carbon b/toolchain/parse/testdata/packages/import/fail_no_semi.carbon index 0b116941ae66..591b6e38f13f 100644 --- a/toolchain/parse/testdata/packages/import/fail_no_semi.carbon +++ b/toolchain/parse/testdata/packages/import/fail_no_semi.carbon @@ -10,9 +10,10 @@ import Geometry -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+10]]:21: error: `import` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+11]]:21: error: `import` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_no_semi.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, diff --git a/toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon b/toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon index 7d0a094e155b..e3ce4963d20b 100644 --- a/toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon +++ b/toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon -// CHECK:STDERR: fail_omit_library_keyword.carbon:[[@LINE+3]]:17: error: missing `library` keyword [MissingLibraryKeyword] +// CHECK:STDERR: fail_omit_library_keyword.carbon:[[@LINE+4]]:17: error: missing `library` keyword [MissingLibraryKeyword] // CHECK:STDERR: import Geometry "Shapes"; // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: import Geometry "Shapes"; // CHECK:STDOUT: - filename: fail_omit_library_keyword.carbon diff --git a/toolchain/parse/testdata/packages/import/fail_type.carbon b/toolchain/parse/testdata/packages/import/fail_type.carbon index 4a98a7e2fd49..9f0bec87d514 100644 --- a/toolchain/parse/testdata/packages/import/fail_type.carbon +++ b/toolchain/parse/testdata/packages/import/fail_type.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_type.carbon -// CHECK:STDERR: fail_type.carbon:[[@LINE+3]]:17: error: `import` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_type.carbon:[[@LINE+4]]:17: error: `import` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: import Geometry api; // CHECK:STDERR: ^~~ +// CHECK:STDERR: import Geometry api; // CHECK:STDOUT: - filename: fail_type.carbon diff --git a/toolchain/parse/testdata/packages/library/fail_in_nested_scope.carbon b/toolchain/parse/testdata/packages/library/fail_in_nested_scope.carbon index 927130f4953a..35756b0e03a2 100644 --- a/toolchain/parse/testdata/packages/library/fail_in_nested_scope.carbon +++ b/toolchain/parse/testdata/packages/library/fail_in_nested_scope.carbon @@ -46,12 +46,13 @@ class C { } fn F() { - // CHECK:STDERR: fail_in_nested_scope.carbon:[[@LINE+6]]:3: error: the `library` declaration must be the first non-comment line [PackageTooLate] + // CHECK:STDERR: fail_in_nested_scope.carbon:[[@LINE+7]]:3: error: the `library` declaration must be the first non-comment line [PackageTooLate] // CHECK:STDERR: impl library "foo"; // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_in_nested_scope.carbon:[[@LINE-39]]:1: note: first non-comment line is here [FirstNonCommentLine] // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: impl library "foo"; } diff --git a/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon b/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon index 9bdf3e42977c..744efed8c585 100644 --- a/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon +++ b/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon @@ -52,9 +52,10 @@ library "[[@TEST_NAME]]" impl library "[[@TEST_NAME]]" -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+46]]:21: error: `library` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+47]]:21: error: `library` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_identifier.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, diff --git a/toolchain/parse/testdata/packages/library/fail_semi_before.carbon b/toolchain/parse/testdata/packages/library/fail_semi_before.carbon index c7249d6e4c5b..00ec73b65c84 100644 --- a/toolchain/parse/testdata/packages/library/fail_semi_before.carbon +++ b/toolchain/parse/testdata/packages/library/fail_semi_before.carbon @@ -10,12 +10,13 @@ ; -// CHECK:STDERR: fail_semi_before.carbon:[[@LINE+6]]:1: error: the `library` declaration must be the first non-comment line [PackageTooLate] +// CHECK:STDERR: fail_semi_before.carbon:[[@LINE+7]]:1: error: the `library` declaration must be the first non-comment line [PackageTooLate] // CHECK:STDERR: library "semi_before"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: note: first non-comment line is here [FirstNonCommentLine] // CHECK:STDERR: ; // CHECK:STDERR: ^ +// CHECK:STDERR: library "[[@TEST_NAME]]"; // CHECK:STDOUT: - filename: fail_semi_before.carbon diff --git a/toolchain/parse/testdata/packages/library/fail_too_late.carbon b/toolchain/parse/testdata/packages/library/fail_too_late.carbon index 59c9285ea87e..1aac94ca691f 100644 --- a/toolchain/parse/testdata/packages/library/fail_too_late.carbon +++ b/toolchain/parse/testdata/packages/library/fail_too_late.carbon @@ -10,12 +10,13 @@ import Geometry; -// CHECK:STDERR: fail_too_late.carbon:[[@LINE+6]]:1: error: the `library` declaration must be the first non-comment line [PackageTooLate] +// CHECK:STDERR: fail_too_late.carbon:[[@LINE+7]]:1: error: the `library` declaration must be the first non-comment line [PackageTooLate] // CHECK:STDERR: library "too_late"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_too_late.carbon:[[@LINE-5]]:1: note: first non-comment line is here [FirstNonCommentLine] // CHECK:STDERR: import Geometry; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: library "[[@TEST_NAME]]"; // CHECK:STDOUT: - filename: fail_too_late.carbon diff --git a/toolchain/parse/testdata/packages/package/fail_after_decl.carbon b/toolchain/parse/testdata/packages/package/fail_after_decl.carbon index a87c4eeff66a..9135cab09100 100644 --- a/toolchain/parse/testdata/packages/package/fail_after_decl.carbon +++ b/toolchain/parse/testdata/packages/package/fail_after_decl.carbon @@ -10,12 +10,13 @@ fn A(); -// CHECK:STDERR: fail_after_decl.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line [PackageTooLate] +// CHECK:STDERR: fail_after_decl.carbon:[[@LINE+7]]:1: error: the `package` declaration must be the first non-comment line [PackageTooLate] // CHECK:STDERR: package B; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_after_decl.carbon:[[@LINE-5]]:1: note: first non-comment line is here [FirstNonCommentLine] // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ +// CHECK:STDERR: package B; // CHECK:STDOUT: - filename: fail_after_decl.carbon diff --git a/toolchain/parse/testdata/packages/package/fail_after_import.carbon b/toolchain/parse/testdata/packages/package/fail_after_import.carbon index 3604c60a0192..038f992956ef 100644 --- a/toolchain/parse/testdata/packages/package/fail_after_import.carbon +++ b/toolchain/parse/testdata/packages/package/fail_after_import.carbon @@ -10,12 +10,13 @@ import A; -// CHECK:STDERR: fail_after_import.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line [PackageTooLate] +// CHECK:STDERR: fail_after_import.carbon:[[@LINE+7]]:1: error: the `package` declaration must be the first non-comment line [PackageTooLate] // CHECK:STDERR: package B; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_after_import.carbon:[[@LINE-5]]:1: note: first non-comment line is here [FirstNonCommentLine] // CHECK:STDERR: import A; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: package B; // CHECK:STDOUT: - filename: fail_after_import.carbon diff --git a/toolchain/parse/testdata/packages/package/fail_after_package.carbon b/toolchain/parse/testdata/packages/package/fail_after_package.carbon index f895b1112a99..ecc4cdf3cde2 100644 --- a/toolchain/parse/testdata/packages/package/fail_after_package.carbon +++ b/toolchain/parse/testdata/packages/package/fail_after_package.carbon @@ -9,12 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_after_package.carbon package A; -// CHECK:STDERR: fail_after_package.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line [PackageTooLate] +// CHECK:STDERR: fail_after_package.carbon:[[@LINE+7]]:1: error: the `package` declaration must be the first non-comment line [PackageTooLate] // CHECK:STDERR: package B; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_after_package.carbon:[[@LINE-4]]:1: note: first non-comment line is here [FirstNonCommentLine] // CHECK:STDERR: package A; // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: package B; // CHECK:STDOUT: - filename: fail_after_package.carbon diff --git a/toolchain/parse/testdata/packages/package/fail_extra_string.carbon b/toolchain/parse/testdata/packages/package/fail_extra_string.carbon index 785541861d4e..b7db4cb3c3f5 100644 --- a/toolchain/parse/testdata/packages/package/fail_extra_string.carbon +++ b/toolchain/parse/testdata/packages/package/fail_extra_string.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_extra_string.carbon -// CHECK:STDERR: fail_extra_string.carbon:[[@LINE+3]]:27: error: `package` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_extra_string.carbon:[[@LINE+4]]:27: error: `package` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: package Foo library "bar" "baz"; // CHECK:STDERR: ^~~~~ +// CHECK:STDERR: package Foo library "bar" "baz"; // CHECK:STDOUT: - filename: fail_extra_string.carbon diff --git a/toolchain/parse/testdata/packages/package/fail_in_nested_scope.carbon b/toolchain/parse/testdata/packages/package/fail_in_nested_scope.carbon index 0652a435e58d..d2ac1830782e 100644 --- a/toolchain/parse/testdata/packages/package/fail_in_nested_scope.carbon +++ b/toolchain/parse/testdata/packages/package/fail_in_nested_scope.carbon @@ -48,12 +48,13 @@ class C { fn F() { // This reaches decl parsing because `impl` is a valid modifier or introducer. - // CHECK:STDERR: fail_in_nested_scope.carbon:[[@LINE+6]]:3: error: the `package` declaration must be the first non-comment line [PackageTooLate] + // CHECK:STDERR: fail_in_nested_scope.carbon:[[@LINE+7]]:3: error: the `package` declaration must be the first non-comment line [PackageTooLate] // CHECK:STDERR: impl package P; // CHECK:STDERR: ^~~~ // CHECK:STDERR: fail_in_nested_scope.carbon:[[@LINE-41]]:1: note: first non-comment line is here [FirstNonCommentLine] // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: impl package P; } diff --git a/toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon b/toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon index 925199d661f2..fc9ca38b1b2b 100644 --- a/toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon +++ b/toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon -// CHECK:STDERR: fail_library_is_identifier.carbon:[[@LINE+3]]:26: error: expected a string literal to specify the library name [ExpectedLibraryName] +// CHECK:STDERR: fail_library_is_identifier.carbon:[[@LINE+4]]:26: error: expected a string literal to specify the library name [ExpectedLibraryName] // CHECK:STDERR: package Geometry library Shapes; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: package Geometry library Shapes; // CHECK:STDOUT: - filename: fail_library_is_identifier.carbon diff --git a/toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon b/toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon index c63e8e329604..bf7a831b90c3 100644 --- a/toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon +++ b/toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon -// CHECK:STDERR: fail_library_skips_name.carbon:[[@LINE+3]]:9: error: expected identifier after `package` [ExpectedIdentifierAfterPackage] +// CHECK:STDERR: fail_library_skips_name.carbon:[[@LINE+4]]:9: error: expected identifier after `package` [ExpectedIdentifierAfterPackage] // CHECK:STDERR: package library "Shapes"; // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: package library "Shapes"; // CHECK:STDOUT: - filename: fail_library_skips_name.carbon diff --git a/toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon b/toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon index 0caf38cdf232..e33629150eac 100644 --- a/toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon +++ b/toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon -// CHECK:STDERR: fail_name_is_keyword.carbon:[[@LINE+3]]:9: error: expected identifier after `package` [ExpectedIdentifierAfterPackage] +// CHECK:STDERR: fail_name_is_keyword.carbon:[[@LINE+4]]:9: error: expected identifier after `package` [ExpectedIdentifierAfterPackage] // CHECK:STDERR: package fn; // CHECK:STDERR: ^~ +// CHECK:STDERR: package fn; // CHECK:STDOUT: - filename: fail_name_is_keyword.carbon diff --git a/toolchain/parse/testdata/packages/package/fail_no_name.carbon b/toolchain/parse/testdata/packages/package/fail_no_name.carbon index 3a64a8710e58..0929534bff04 100644 --- a/toolchain/parse/testdata/packages/package/fail_no_name.carbon +++ b/toolchain/parse/testdata/packages/package/fail_no_name.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_no_name.carbon -// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:8: error: expected identifier after `package` [ExpectedIdentifierAfterPackage] +// CHECK:STDERR: fail_no_name.carbon:[[@LINE+4]]:8: error: expected identifier after `package` [ExpectedIdentifierAfterPackage] // CHECK:STDERR: package; // CHECK:STDERR: ^ +// CHECK:STDERR: package; // CHECK:STDOUT: - filename: fail_no_name.carbon diff --git a/toolchain/parse/testdata/packages/package/fail_no_semi.carbon b/toolchain/parse/testdata/packages/package/fail_no_semi.carbon index 2e742be21238..3ea7c1e1408a 100644 --- a/toolchain/parse/testdata/packages/package/fail_no_semi.carbon +++ b/toolchain/parse/testdata/packages/package/fail_no_semi.carbon @@ -10,9 +10,10 @@ package Geometry -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+10]]:21: error: `package` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+11]]:21: error: `package` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_no_semi.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, diff --git a/toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon b/toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon index 6d47d984c3ad..6d6ae2b48bb2 100644 --- a/toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon +++ b/toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon -// CHECK:STDERR: fail_omit_library_keyword.carbon:[[@LINE+3]]:18: error: missing `library` keyword [MissingLibraryKeyword] +// CHECK:STDERR: fail_omit_library_keyword.carbon:[[@LINE+4]]:18: error: missing `library` keyword [MissingLibraryKeyword] // CHECK:STDERR: package Geometry "Shapes"; // CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: package Geometry "Shapes"; // CHECK:STDOUT: - filename: fail_omit_library_keyword.carbon diff --git a/toolchain/parse/testdata/packages/package/fail_semi_before.carbon b/toolchain/parse/testdata/packages/package/fail_semi_before.carbon index 3096ee9d63f1..8952c3e8d029 100644 --- a/toolchain/parse/testdata/packages/package/fail_semi_before.carbon +++ b/toolchain/parse/testdata/packages/package/fail_semi_before.carbon @@ -10,12 +10,13 @@ ; -// CHECK:STDERR: fail_semi_before.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line [PackageTooLate] +// CHECK:STDERR: fail_semi_before.carbon:[[@LINE+7]]:1: error: the `package` declaration must be the first non-comment line [PackageTooLate] // CHECK:STDERR: package Geometry; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: note: first non-comment line is here [FirstNonCommentLine] // CHECK:STDERR: ; // CHECK:STDERR: ^ +// CHECK:STDERR: package Geometry; // CHECK:STDOUT: - filename: fail_semi_before.carbon diff --git a/toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon b/toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon index 3563980f35e0..1c13eb19fa8c 100644 --- a/toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon +++ b/toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon -// CHECK:STDERR: fail_trailing_impl.carbon:[[@LINE+3]]:18: error: `package` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_trailing_impl.carbon:[[@LINE+4]]:18: error: `package` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: package Geometry impl; // CHECK:STDERR: ^~~~ +// CHECK:STDERR: package Geometry impl; // CHECK:STDOUT: - filename: fail_trailing_impl.carbon diff --git a/toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon b/toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon index ad3b49d9ca3a..1a0da65dcf7c 100644 --- a/toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon +++ b/toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon fn F() -> i32 { - // CHECK:STDERR: fail_pointer_type_in_expr.carbon:[[@LINE+3]]:14: error: parentheses are required to disambiguate operator precedence [OperatorRequiresParentheses] + // CHECK:STDERR: fail_pointer_type_in_expr.carbon:[[@LINE+4]]:14: error: parentheses are required to disambiguate operator precedence [OperatorRequiresParentheses] // CHECK:STDERR: return *i32*; // CHECK:STDERR: ^ + // CHECK:STDERR: return *i32*; } diff --git a/toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon b/toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon index 02de2fea2835..7c1a9f57c0a4 100644 --- a/toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon +++ b/toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon @@ -51,9 +51,10 @@ fn F() { // CHECK:STDERR: t->(2, 3); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+3]]:9: error: expected `)` [UnexpectedTokenInCompoundMemberAccess] + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:9: error: expected `)` [UnexpectedTokenInCompoundMemberAccess] // CHECK:STDERR: s->(g h i ()); // CHECK:STDERR: ^ + // CHECK:STDERR: s->(g h i ()); } diff --git a/toolchain/parse/testdata/return/fail_expr_no_semi.carbon b/toolchain/parse/testdata/return/fail_expr_no_semi.carbon index ebd9d229dbe2..5ef845d07bc4 100644 --- a/toolchain/parse/testdata/return/fail_expr_no_semi.carbon +++ b/toolchain/parse/testdata/return/fail_expr_no_semi.carbon @@ -10,9 +10,10 @@ fn F() { return x -// CHECK:STDERR: fail_expr_no_semi.carbon:[[@LINE+3]]:1: error: `return` statements must end with a `;` [ExpectedStatementSemi] +// CHECK:STDERR: fail_expr_no_semi.carbon:[[@LINE+4]]:1: error: `return` statements must end with a `;` [ExpectedStatementSemi] // CHECK:STDERR: } // CHECK:STDERR: ^ +// CHECK:STDERR: } // CHECK:STDOUT: - filename: fail_expr_no_semi.carbon diff --git a/toolchain/parse/testdata/return/fail_no_semi.carbon b/toolchain/parse/testdata/return/fail_no_semi.carbon index 2b1c3f03143f..4ffa13762468 100644 --- a/toolchain/parse/testdata/return/fail_no_semi.carbon +++ b/toolchain/parse/testdata/return/fail_no_semi.carbon @@ -10,13 +10,14 @@ fn F() { return -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+7]]:1: error: expected expression [ExpectedExpr] +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+8]]:1: error: expected expression [ExpectedExpr] // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:1: error: `return` statements must end with a `;` [ExpectedStatementSemi] +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+4]]:1: error: `return` statements must end with a `;` [ExpectedStatementSemi] // CHECK:STDERR: } // CHECK:STDERR: ^ +// CHECK:STDERR: } // CHECK:STDOUT: - filename: fail_no_semi.carbon diff --git a/toolchain/parse/testdata/return/fail_returned_no_var.carbon b/toolchain/parse/testdata/return/fail_returned_no_var.carbon index fbbf4dee5361..c6bb1d35b5eb 100644 --- a/toolchain/parse/testdata/return/fail_returned_no_var.carbon +++ b/toolchain/parse/testdata/return/fail_returned_no_var.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/return/fail_returned_no_var.carbon fn F() -> String { - // CHECK:STDERR: fail_returned_no_var.carbon:[[@LINE+3]]:12: error: expected `var` after `returned` [ExpectedVarAfterReturned] + // CHECK:STDERR: fail_returned_no_var.carbon:[[@LINE+4]]:12: error: expected `var` after `returned` [ExpectedVarAfterReturned] // CHECK:STDERR: returned fn G() -> i32; // CHECK:STDERR: ^~ + // CHECK:STDERR: returned fn G() -> i32; } diff --git a/toolchain/parse/testdata/return/fail_var_no_semi.carbon b/toolchain/parse/testdata/return/fail_var_no_semi.carbon index e6cc5d4c5bb6..e944a647acab 100644 --- a/toolchain/parse/testdata/return/fail_var_no_semi.carbon +++ b/toolchain/parse/testdata/return/fail_var_no_semi.carbon @@ -10,9 +10,10 @@ fn F() { return var -// CHECK:STDERR: fail_var_no_semi.carbon:[[@LINE+3]]:1: error: `return` statements must end with a `;` [ExpectedStatementSemi] +// CHECK:STDERR: fail_var_no_semi.carbon:[[@LINE+4]]:1: error: `return` statements must end with a `;` [ExpectedStatementSemi] // CHECK:STDERR: } // CHECK:STDERR: ^ +// CHECK:STDERR: } // CHECK:STDOUT: - filename: fail_var_no_semi.carbon diff --git a/toolchain/parse/testdata/struct/fail_comma_only.carbon b/toolchain/parse/testdata/struct/fail_comma_only.carbon index 85dd0e3994eb..c38f094d214c 100644 --- a/toolchain/parse/testdata/struct/fail_comma_only.carbon +++ b/toolchain/parse/testdata/struct/fail_comma_only.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_comma_only.carbon -// CHECK:STDERR: fail_comma_only.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` [ExpectedStructLiteralField] +// CHECK:STDERR: fail_comma_only.carbon:[[@LINE+4]]:9: error: expected `.field: field_type` or `.field = value` [ExpectedStructLiteralField] // CHECK:STDERR: var x: {,} = {}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: {,} = {}; // CHECK:STDOUT: - filename: fail_comma_only.carbon diff --git a/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon b/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon index 2ee4ff188883..39584d048a1e 100644 --- a/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon +++ b/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon -// CHECK:STDERR: fail_comma_repeat_in_type.carbon:[[@LINE+3]]:17: error: expected `.field: field_type` [ExpectedStructLiteralField] +// CHECK:STDERR: fail_comma_repeat_in_type.carbon:[[@LINE+4]]:17: error: expected `.field: field_type` [ExpectedStructLiteralField] // CHECK:STDERR: var x: {.a: i32,,} = {}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: {.a: i32,,} = {}; // CHECK:STDOUT: - filename: fail_comma_repeat_in_type.carbon diff --git a/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon b/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon index 1430ef5aea1f..17bc7a8572d5 100644 --- a/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon +++ b/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon -// CHECK:STDERR: fail_comma_repeat_in_value.carbon:[[@LINE+3]]:16: error: expected `.field = value` [ExpectedStructLiteralField] +// CHECK:STDERR: fail_comma_repeat_in_value.carbon:[[@LINE+4]]:16: error: expected `.field = value` [ExpectedStructLiteralField] // CHECK:STDERR: var x: {.a = 0,,} = {}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: {.a = 0,,} = {}; // CHECK:STDOUT: - filename: fail_comma_repeat_in_value.carbon diff --git a/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon b/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon index 4411a25796f5..218ae72e632e 100644 --- a/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon +++ b/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon -// CHECK:STDERR: fail_extra_token_in_type.carbon:[[@LINE+3]]:17: error: expected `,` or `}` [UnexpectedTokenAfterListElement] +// CHECK:STDERR: fail_extra_token_in_type.carbon:[[@LINE+4]]:17: error: expected `,` or `}` [UnexpectedTokenAfterListElement] // CHECK:STDERR: var x: {.a: i32 banana} = {.a = 0}; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: var x: {.a: i32 banana} = {.a = 0}; // CHECK:STDOUT: - filename: fail_extra_token_in_type.carbon diff --git a/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon b/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon index 79dbd3aa0f68..bcbd471b51f4 100644 --- a/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon +++ b/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon -// CHECK:STDERR: fail_extra_token_in_value.carbon:[[@LINE+3]]:28: error: expected `,` or `}` [UnexpectedTokenAfterListElement] +// CHECK:STDERR: fail_extra_token_in_value.carbon:[[@LINE+4]]:28: error: expected `,` or `}` [UnexpectedTokenAfterListElement] // CHECK:STDERR: var x: {.a: i32} = {.a = 0 banana}; // CHECK:STDERR: ^~~~~~ +// CHECK:STDERR: var x: {.a: i32} = {.a = 0 banana}; // CHECK:STDOUT: - filename: fail_extra_token_in_value.carbon diff --git a/toolchain/parse/testdata/struct/fail_identifier_colon.carbon b/toolchain/parse/testdata/struct/fail_identifier_colon.carbon index 0bab495e6808..838dcde4b43a 100644 --- a/toolchain/parse/testdata/struct/fail_identifier_colon.carbon +++ b/toolchain/parse/testdata/struct/fail_identifier_colon.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_identifier_colon.carbon -// CHECK:STDERR: fail_identifier_colon.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` [ExpectedStructLiteralField] +// CHECK:STDERR: fail_identifier_colon.carbon:[[@LINE+4]]:9: error: expected `.field: field_type` or `.field = value` [ExpectedStructLiteralField] // CHECK:STDERR: var x: {a:} = {}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: {a:} = {}; // CHECK:STDOUT: - filename: fail_identifier_colon.carbon diff --git a/toolchain/parse/testdata/struct/fail_identifier_equals.carbon b/toolchain/parse/testdata/struct/fail_identifier_equals.carbon index 6394a90f2bec..387d8692b97c 100644 --- a/toolchain/parse/testdata/struct/fail_identifier_equals.carbon +++ b/toolchain/parse/testdata/struct/fail_identifier_equals.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_identifier_equals.carbon -// CHECK:STDERR: fail_identifier_equals.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` [ExpectedStructLiteralField] +// CHECK:STDERR: fail_identifier_equals.carbon:[[@LINE+4]]:9: error: expected `.field: field_type` or `.field = value` [ExpectedStructLiteralField] // CHECK:STDERR: var x: {a=} = {}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: {a=} = {}; // CHECK:STDOUT: - filename: fail_identifier_equals.carbon diff --git a/toolchain/parse/testdata/struct/fail_identifier_only.carbon b/toolchain/parse/testdata/struct/fail_identifier_only.carbon index 1a222956f93e..c8f4d1e49ea2 100644 --- a/toolchain/parse/testdata/struct/fail_identifier_only.carbon +++ b/toolchain/parse/testdata/struct/fail_identifier_only.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_identifier_only.carbon -// CHECK:STDERR: fail_identifier_only.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` [ExpectedStructLiteralField] +// CHECK:STDERR: fail_identifier_only.carbon:[[@LINE+4]]:9: error: expected `.field: field_type` or `.field = value` [ExpectedStructLiteralField] // CHECK:STDERR: var x: {a} = {}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: {a} = {}; // CHECK:STDOUT: - filename: fail_identifier_only.carbon diff --git a/toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon b/toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon index bf8e73278358..c74c1798e712 100644 --- a/toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon +++ b/toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon -// CHECK:STDERR: fail_invalid_struct_designator.carbon:[[@LINE+3]]:16: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] +// CHECK:STDERR: fail_invalid_struct_designator.carbon:[[@LINE+4]]:16: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] // CHECK:STDERR: var x: i32 = {.7 = 8}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: i32 = {.7 = 8}; // CHECK:STDOUT: - filename: fail_invalid_struct_designator.carbon diff --git a/toolchain/parse/testdata/struct/fail_missing_type.carbon b/toolchain/parse/testdata/struct/fail_missing_type.carbon index ef0d709e7b41..bca4a9e4707f 100644 --- a/toolchain/parse/testdata/struct/fail_missing_type.carbon +++ b/toolchain/parse/testdata/struct/fail_missing_type.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_missing_type.carbon -// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+3]]:12: error: expected expression [ExpectedExpr] +// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+4]]:12: error: expected expression [ExpectedExpr] // CHECK:STDERR: var x: {.a:} = {}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: {.a:} = {}; // CHECK:STDOUT: - filename: fail_missing_type.carbon diff --git a/toolchain/parse/testdata/struct/fail_missing_value.carbon b/toolchain/parse/testdata/struct/fail_missing_value.carbon index f8ce7b6153f6..bf03b7f1e001 100644 --- a/toolchain/parse/testdata/struct/fail_missing_value.carbon +++ b/toolchain/parse/testdata/struct/fail_missing_value.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_missing_value.carbon -// CHECK:STDERR: fail_missing_value.carbon:[[@LINE+3]]:12: error: expected expression [ExpectedExpr] +// CHECK:STDERR: fail_missing_value.carbon:[[@LINE+4]]:12: error: expected expression [ExpectedExpr] // CHECK:STDERR: var x: {.a=} = {}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: {.a=} = {}; // CHECK:STDOUT: - filename: fail_missing_value.carbon diff --git a/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon b/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon index 065ea2143dc2..9a94c6ecb3a1 100644 --- a/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon +++ b/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon -// CHECK:STDERR: fail_mix_type_and_value.carbon:[[@LINE+3]]:21: error: expected `.field: field_type` [ExpectedStructLiteralField] +// CHECK:STDERR: fail_mix_type_and_value.carbon:[[@LINE+4]]:21: error: expected `.field: field_type` [ExpectedStructLiteralField] // CHECK:STDERR: var x: {.a: i32, .b = 0} = {}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: {.a: i32, .b = 0} = {}; // CHECK:STDOUT: - filename: fail_mix_type_and_value.carbon diff --git a/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon b/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon index 25bcd3792645..6865024b4be2 100644 --- a/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon +++ b/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon -// CHECK:STDERR: fail_mix_value_and_type.carbon:[[@LINE+3]]:17: error: expected `.field = value` [ExpectedStructLiteralField] +// CHECK:STDERR: fail_mix_value_and_type.carbon:[[@LINE+4]]:17: error: expected `.field = value` [ExpectedStructLiteralField] // CHECK:STDERR: var x: {.a = 0, b: i32} = {}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: {.a = 0, b: i32} = {}; // CHECK:STDOUT: - filename: fail_mix_value_and_type.carbon diff --git a/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon b/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon index 7bdaced29094..2af751c13f42 100644 --- a/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon +++ b/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon @@ -18,13 +18,14 @@ // CHECK:STDERR: var x: i32 = {.a = 1, .b, .c: i32}; -// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+7]]:26: error: expected `.field: field_type` [ExpectedStructLiteralField] +// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+8]]:26: error: expected `.field: field_type` [ExpectedStructLiteralField] // CHECK:STDERR: var x: i32 = {.a: i32, .b, .c = 1}; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+3]]:31: error: expected `.field: field_type` [ExpectedStructLiteralField] +// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+4]]:31: error: expected `.field: field_type` [ExpectedStructLiteralField] // CHECK:STDERR: var x: i32 = {.a: i32, .b, .c = 1}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: i32 = {.a: i32, .b, .c = 1}; // CHECK:STDOUT: - filename: fail_mix_with_unknown.carbon diff --git a/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon b/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon index 732b42731bea..32a1ff904fe5 100644 --- a/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon +++ b/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon -// CHECK:STDERR: fail_no_colon_or_equals.carbon:[[@LINE+3]]:11: error: expected `.field: field_type` or `.field = value` [ExpectedStructLiteralField] +// CHECK:STDERR: fail_no_colon_or_equals.carbon:[[@LINE+4]]:11: error: expected `.field: field_type` or `.field = value` [ExpectedStructLiteralField] // CHECK:STDERR: var x: {.a} = {}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: {.a} = {}; // CHECK:STDOUT: - filename: fail_no_colon_or_equals.carbon diff --git a/toolchain/parse/testdata/struct/fail_period_only.carbon b/toolchain/parse/testdata/struct/fail_period_only.carbon index a1e8cdcb0c0b..a349b02ef6cf 100644 --- a/toolchain/parse/testdata/struct/fail_period_only.carbon +++ b/toolchain/parse/testdata/struct/fail_period_only.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_only.carbon -// CHECK:STDERR: fail_period_only.carbon:[[@LINE+3]]:10: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] +// CHECK:STDERR: fail_period_only.carbon:[[@LINE+4]]:10: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] // CHECK:STDERR: var x: {.} = {}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: {.} = {}; // CHECK:STDOUT: - filename: fail_period_only.carbon diff --git a/toolchain/parse/testdata/struct/fail_period_paren.carbon b/toolchain/parse/testdata/struct/fail_period_paren.carbon index 7383cb210fee..cf686a58718e 100644 --- a/toolchain/parse/testdata/struct/fail_period_paren.carbon +++ b/toolchain/parse/testdata/struct/fail_period_paren.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_paren.carbon -// CHECK:STDERR: fail_period_paren.carbon:[[@LINE+3]]:10: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] +// CHECK:STDERR: fail_period_paren.carbon:[[@LINE+4]]:10: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] // CHECK:STDERR: var x: {.(a) = 1}; // CHECK:STDERR: ^ +// CHECK:STDERR: var x: {.(a) = 1}; // CHECK:STDOUT: - filename: fail_period_paren.carbon diff --git a/toolchain/parse/testdata/struct/fail_period_string_colon.carbon b/toolchain/parse/testdata/struct/fail_period_string_colon.carbon index b6e9ed9de706..36b6cc1d6340 100644 --- a/toolchain/parse/testdata/struct/fail_period_string_colon.carbon +++ b/toolchain/parse/testdata/struct/fail_period_string_colon.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_string_colon.carbon -// CHECK:STDERR: fail_period_string_colon.carbon:[[@LINE+3]]:10: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] +// CHECK:STDERR: fail_period_string_colon.carbon:[[@LINE+4]]:10: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] // CHECK:STDERR: var x: {."hello": i32, .y: i32} = {}; // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: var x: {."hello": i32, .y: i32} = {}; // CHECK:STDOUT: - filename: fail_period_string_colon.carbon diff --git a/toolchain/parse/testdata/struct/fail_period_string_equals.carbon b/toolchain/parse/testdata/struct/fail_period_string_equals.carbon index 02d027ad9bc2..8593144126f6 100644 --- a/toolchain/parse/testdata/struct/fail_period_string_equals.carbon +++ b/toolchain/parse/testdata/struct/fail_period_string_equals.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_string_equals.carbon -// CHECK:STDERR: fail_period_string_equals.carbon:[[@LINE+3]]:10: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] +// CHECK:STDERR: fail_period_string_equals.carbon:[[@LINE+4]]:10: error: expected identifier after `.` [ExpectedIdentifierAfterPeriodOrArrow] // CHECK:STDERR: var x: {."hello" = 0, .y = 4} = {}; // CHECK:STDERR: ^~~~~~~ +// CHECK:STDERR: var x: {."hello" = 0, .y = 4} = {}; // CHECK:STDOUT: - filename: fail_period_string_equals.carbon diff --git a/toolchain/parse/testdata/struct/fail_type_no_designator.carbon b/toolchain/parse/testdata/struct/fail_type_no_designator.carbon index d2146c450169..1d07c17dc80d 100644 --- a/toolchain/parse/testdata/struct/fail_type_no_designator.carbon +++ b/toolchain/parse/testdata/struct/fail_type_no_designator.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_type_no_designator.carbon -// CHECK:STDERR: fail_type_no_designator.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` [ExpectedStructLiteralField] +// CHECK:STDERR: fail_type_no_designator.carbon:[[@LINE+4]]:9: error: expected `.field: field_type` or `.field = value` [ExpectedStructLiteralField] // CHECK:STDERR: var x: {i32} = {}; // CHECK:STDERR: ^~~ +// CHECK:STDERR: var x: {i32} = {}; // CHECK:STDOUT: - filename: fail_type_no_designator.carbon diff --git a/toolchain/parse/testdata/var/fail_bad_name.carbon b/toolchain/parse/testdata/var/fail_bad_name.carbon index b790f624686d..faaa2ee85e10 100644 --- a/toolchain/parse/testdata/var/fail_bad_name.carbon +++ b/toolchain/parse/testdata/var/fail_bad_name.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/var/fail_bad_name.carbon -// CHECK:STDERR: fail_bad_name.carbon:[[@LINE+3]]:5: error: expected name in binding pattern [ExpectedBindingPattern] +// CHECK:STDERR: fail_bad_name.carbon:[[@LINE+4]]:5: error: expected name in binding pattern [ExpectedBindingPattern] // CHECK:STDERR: var *; // CHECK:STDERR: ^ +// CHECK:STDERR: var *; // CHECK:STDOUT: - filename: fail_bad_name.carbon diff --git a/toolchain/parse/testdata/var/fail_empty.carbon b/toolchain/parse/testdata/var/fail_empty.carbon index 2a72f4f727e3..c0977bfb2fe6 100644 --- a/toolchain/parse/testdata/var/fail_empty.carbon +++ b/toolchain/parse/testdata/var/fail_empty.carbon @@ -8,9 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/var/fail_empty.carbon -// CHECK:STDERR: fail_empty.carbon:[[@LINE+3]]:4: error: expected name in binding pattern [ExpectedBindingPattern] +// CHECK:STDERR: fail_empty.carbon:[[@LINE+4]]:4: error: expected name in binding pattern [ExpectedBindingPattern] // CHECK:STDERR: var; // CHECK:STDERR: ^ +// CHECK:STDERR: var; // CHECK:STDOUT: - filename: fail_empty.carbon diff --git a/toolchain/parse/testdata/var/fail_no_semi.carbon b/toolchain/parse/testdata/var/fail_no_semi.carbon index 49d09c4fc41f..1f1ffc049c87 100644 --- a/toolchain/parse/testdata/var/fail_no_semi.carbon +++ b/toolchain/parse/testdata/var/fail_no_semi.carbon @@ -10,13 +10,14 @@ var -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+16]]:21: error: expected name in binding pattern [ExpectedBindingPattern] +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+17]]:21: error: expected name in binding pattern [ExpectedBindingPattern] // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+12]]:21: error: `var` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+13]]:21: error: `var` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: fail_no_semi.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, diff --git a/toolchain/parse/testdata/where_expr/designators.carbon b/toolchain/parse/testdata/where_expr/designators.carbon index 7dace1a56f05..36996361f1e2 100644 --- a/toolchain/parse/testdata/where_expr/designators.carbon +++ b/toolchain/parse/testdata/where_expr/designators.carbon @@ -59,13 +59,14 @@ fn FailStar() { var x: i32 = . -// CHECK:STDERR: fail_designator_eof.carbon:[[@LINE+93]]:21: error: expected identifier or `Self` after `.` [ExpectedIdentifierOrSelfAfterPeriod] +// CHECK:STDERR: fail_designator_eof.carbon:[[@LINE+94]]:21: error: expected identifier or `Self` after `.` [ExpectedIdentifierOrSelfAfterPeriod] // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_designator_eof.carbon:[[@LINE+89]]:21: error: `var` declarations must end with a `;` [ExpectedDeclSemi] +// CHECK:STDERR: fail_designator_eof.carbon:[[@LINE+90]]:21: error: `var` declarations must end with a `;` [ExpectedDeclSemi] // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ +// CHECK:STDERR: // CHECK:STDOUT: - filename: designator.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, diff --git a/toolchain/parse/testdata/where_expr/fail_rewrite.carbon b/toolchain/parse/testdata/where_expr/fail_rewrite.carbon index 6966676937bb..12dd59cba259 100644 --- a/toolchain/parse/testdata/where_expr/fail_rewrite.carbon +++ b/toolchain/parse/testdata/where_expr/fail_rewrite.carbon @@ -61,9 +61,10 @@ fn BinaryOpAfterDesignator(Y:! N where .O + .P = {}); // --- fail_after_and.carbon -// CHECK:STDERR: fail_after_and.carbon:[[@LINE+3]]:43: error: requirement can only use `=` after `.member` designator [RequirementEqualAfterNonDesignator] +// CHECK:STDERR: fail_after_and.carbon:[[@LINE+4]]:43: error: requirement can only use `=` after `.member` designator [RequirementEqualAfterNonDesignator] // CHECK:STDERR: fn AfterAnd(Z:! Q where .R impls S and () = .A); // CHECK:STDERR: ^ +// CHECK:STDERR: fn AfterAnd(Z:! Q where .R impls S and () = .A); // CHECK:STDOUT: - filename: fail_not_designator.carbon diff --git a/toolchain/parse/testdata/where_expr/where_and.carbon b/toolchain/parse/testdata/where_expr/where_and.carbon index b85a4e35cdee..c447e1ca2f10 100644 --- a/toolchain/parse/testdata/where_expr/where_and.carbon +++ b/toolchain/parse/testdata/where_expr/where_and.carbon @@ -32,9 +32,10 @@ fn AndSuffix(Y:! I where .J impls K and); // --- fail_and_early.carbon -// CHECK:STDERR: fail_and_early.carbon:[[@LINE+3]]:28: error: requirement should use `impls`, `=`, or `==` operator [ExpectedRequirementOperator] +// CHECK:STDERR: fail_and_early.carbon:[[@LINE+4]]:28: error: requirement should use `impls`, `=`, or `==` operator [ExpectedRequirementOperator] // CHECK:STDERR: fn AndEarly(Z:! L where .M and N); // CHECK:STDERR: ^~~ +// CHECK:STDERR: fn AndEarly(Z:! L where .M and N); // CHECK:STDOUT: - filename: success.carbon diff --git a/toolchain/parse/testdata/while/fail_missing_cond.carbon b/toolchain/parse/testdata/while/fail_missing_cond.carbon index 9d499564339d..851e803623b1 100644 --- a/toolchain/parse/testdata/while/fail_missing_cond.carbon +++ b/toolchain/parse/testdata/while/fail_missing_cond.carbon @@ -9,9 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/while/fail_missing_cond.carbon fn F() { - // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:9: error: expected `(` after `while` [ExpectedParenAfter] + // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+4]]:9: error: expected `(` after `while` [ExpectedParenAfter] // CHECK:STDERR: while { // CHECK:STDERR: ^ + // CHECK:STDERR: while { } } diff --git a/toolchain/parse/testdata/while/fail_no_semi.carbon b/toolchain/parse/testdata/while/fail_no_semi.carbon index 59a017d7aa24..1480b7e0a100 100644 --- a/toolchain/parse/testdata/while/fail_no_semi.carbon +++ b/toolchain/parse/testdata/while/fail_no_semi.carbon @@ -19,9 +19,10 @@ fn F() { } if (c) { continue - // CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:5: error: `continue` statements must end with a `;` [ExpectedStatementSemi] + // CHECK:STDERR: fail_no_semi.carbon:[[@LINE+4]]:5: error: `continue` statements must end with a `;` [ExpectedStatementSemi] // CHECK:STDERR: } // CHECK:STDERR: ^ + // CHECK:STDERR: } } } diff --git a/toolchain/parse/testdata/while/fail_unbraced.carbon b/toolchain/parse/testdata/while/fail_unbraced.carbon index adc014f7f192..c19903aa9087 100644 --- a/toolchain/parse/testdata/while/fail_unbraced.carbon +++ b/toolchain/parse/testdata/while/fail_unbraced.carbon @@ -11,9 +11,10 @@ fn F() { while (a) - // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+3]]:5: error: expected braced code block [ExpectedCodeBlock] + // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+4]]:5: error: expected braced code block [ExpectedCodeBlock] // CHECK:STDERR: break; // CHECK:STDERR: ^~~~~ + // CHECK:STDERR: break; } diff --git a/toolchain/testing/file_test.cpp b/toolchain/testing/file_test.cpp index 60279793483f..83b0d2a8d0c5 100644 --- a/toolchain/testing/file_test.cpp +++ b/toolchain/testing/file_test.cpp @@ -46,6 +46,13 @@ class ToolchainFileTest : public FileTestBase { Driver driver(fs, &installation_, stdout, stderr); auto driver_result = driver.RunCommand(test_args); + // If any diagnostics have been produced, add a trailing newline to make the + // last diagnostic match intermediate diagnostics (that have a newline + // separator between them). This reduces churn when adding new diagnostics + // to test cases. + if (stderr.tell() > 0) { + stderr << '\n'; + } RunResult result{ .success = driver_result.success,