1 // RUN: not clang-tblgen -gen-clang-diags-defs -I%S %s -o /dev/null 2>&1 | FileCheck %s
2 include "DiagnosticBase.inc"
4 // Ensure we catch a capital letter at the start of a diagnostic.
7 // CHECK-DAG: wording-errors.td:[[@LINE-2]]:5: error: Diagnostics should not start with a capital letter; 'This' is invalid
9 // Test that we also correctly handle selections.
11 "%select{|or}0 That">;
12 // CHECK-DAG: wording-errors.td:[[@LINE-2]]:5: error: Diagnostics should not start with a capital letter; 'That' is invalid
14 "%select{as does|}0 This">;
15 // CHECK-DAG: wording-errors.td:[[@LINE-2]]:5: error: Diagnostics should not start with a capital letter; 'This' is invalid
17 "%select{and||of course}0 Whatever">;
18 // CHECK-DAG: wording-errors.td:[[@LINE-2]]:5: error: Diagnostics should not start with a capital letter; 'Whatever' is invalid
20 // Test that we accept the following cases.
24 "%select{this|is|also}0 Fine">;
26 "%select{this|is|also|}0 fine">;
28 "%select{ARC|C|C23|C++14|OpenMP}0 are also fine">;
30 // Next, test that we catch punctuation at the end of the diagnostic.
32 "punctuation is bad.">;
33 // CHECK-DAG: wording-errors.td:[[@LINE-2]]:5: error: Diagnostics should not end with punctuation; '.' is invalid
36 // CHECK-DAG: wording-errors.td:[[@LINE-2]]:5: error: Diagnostics should not end with punctuation; '!' is invalid
38 "we also catch %select{punctuation.|in select}0">;
39 // CHECK-DAG: wording-errors.td:[[@LINE-2]]:5: error: Diagnostics should not end with punctuation; '.' is invalid
41 "and %select{|here.}0">;
42 // CHECK-DAG: wording-errors.td:[[@LINE-2]]:5: error: Diagnostics should not end with punctuation; '.' is invalid
44 "and %select{here.|}0">;
45 // CHECK-DAG: wording-errors.td:[[@LINE-2]]:5: error: Diagnostics should not end with punctuation; '.' is invalid
47 "and even %select{|here.|}0">;
48 // CHECK-DAG: wording-errors.td:[[@LINE-2]]:5: error: Diagnostics should not end with punctuation; '.' is invalid
50 "and %select{here}0.">;
51 // CHECK-DAG: wording-errors.td:[[@LINE-2]]:5: error: Diagnostics should not end with punctuation; '.' is invalid
53 // Test that we accept the following cases.
55 "question marks are intentionally okay?">;