Support printing the diagnostic kind for verification. (#4425)

This is to help identify which diagnostics we're actually using.

Note that driver/testdata still has tests which don't pass this flag,
and so continue to test the kind-less (default) behavior.
This commit is contained in:
Jon Ross-Perkins
2024-10-18 22:33:56 +00:00
committed by GitHub
parent e3950298cf
commit 62c36eceda
530 changed files with 1951 additions and 1931 deletions
@@ -9,7 +9,7 @@
// 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
// CHECK:STDERR: fail_pointer_type_in_expr.carbon:[[@LINE+3]]:14: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence
// CHECK:STDERR: return *i32*;
// CHECK:STDERR: ^
return *i32*;
@@ -9,49 +9,49 @@
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon
fn F() {
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:6: error: expected expression
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:6: error(ExpectedExpr): expected expression
// CHECK:STDERR: x.();
// CHECK:STDERR: ^
// CHECK:STDERR:
x.();
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error: expected `)`
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error(UnexpectedTokenInCompoundMemberAccess): expected `)`
// CHECK:STDERR: y.(1,);
// CHECK:STDERR: ^
// CHECK:STDERR:
y.(1,);
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error: expected `)`
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error(UnexpectedTokenInCompoundMemberAccess): expected `)`
// CHECK:STDERR: z.(a, b);
// CHECK:STDERR: ^
// CHECK:STDERR:
z.(a, b);
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error: expected `)`
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error(UnexpectedTokenInCompoundMemberAccess): expected `)`
// CHECK:STDERR: w.(c d e ());
// CHECK:STDERR: ^
// CHECK:STDERR:
w.(c d e ());
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error: expected expression
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error(ExpectedExpr): expected expression
// CHECK:STDERR: v->();
// CHECK:STDERR: ^
// CHECK:STDERR:
v->();
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error: expected `)`
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error(UnexpectedTokenInCompoundMemberAccess): expected `)`
// CHECK:STDERR: u->(f,);
// CHECK:STDERR: ^
// CHECK:STDERR:
u->(f,);
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error: expected `)`
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error(UnexpectedTokenInCompoundMemberAccess): expected `)`
// CHECK:STDERR: t->(2, 3);
// CHECK:STDERR: ^
// CHECK:STDERR:
t->(2, 3);
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+3]]:9: error: expected `)`
// CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+3]]:9: error(UnexpectedTokenInCompoundMemberAccess): expected `)`
// CHECK:STDERR: s->(g h i ());
// CHECK:STDERR: ^
s->(g h i ());