[llvm] [FileCheck] improve prefix validation (PR #92248)

Paul T Robinson via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 14:31:16 PDT 2024


================
@@ -2468,13 +2468,16 @@ FileCheckString::CheckDag(const SourceMgr &SM, StringRef Buffer,
 
 static bool ValidatePrefixes(StringRef Kind, StringSet<> &UniquePrefixes,
                              ArrayRef<StringRef> SuppliedPrefixes) {
+  static const char *Directives[] = {"-NEXT",  "-SAME", "-EMPTY", "-NOT",
+                                     "-COUNT", "-DAG",  "-LABEL"};
----------------
pogo59 wrote:

These should be called Suffixes not Directives.

There is a place that checks for some (but not all) cases of multiple suffixes, in the test file. That place should use the same list of suffixes that this function does. Ideally that place would also be enhanced to check for all combinations.

https://github.com/llvm/llvm-project/pull/92248


More information about the llvm-commits mailing list