[PATCH] [FileCheck] Fix a bug that cause FileCheck to misidentify check-prefix

Ron Ofir ron.ofir at gmail.com
Fri Aug 2 13:39:00 PDT 2013


  Currently FileCheck doesn't validate CheckPrefix, so it can be any string (!@#$!sdg5sdf is just fine), however a quick search in .test files in LLVM, Clang and LLD shows that the convention is pretty the same as C/++ variable names, except that - is also valid inside a prefix. So the unwritten rules are now:
  1. Can contain any alphanumeric, plus hyphen and underscore
  2. Must start with a letter
  3. (usually uppercase, though not always)

  I suggest to use the first two rules and add a check to make sure that the supplied prefix is valid and stop with an error message otherwise.

  As for the logic, you're absolutely right, I have no idea what I was thinking...

http://llvm-reviews.chandlerc.com/D1271



More information about the llvm-commits mailing list