Twine(Pat.getCheckTy() == Check::CheckEmpty ? "-EMPTY" : "-NEXT");
// Count the number of newlines between the previous match and this one.
- assert(Buffer.data() !=
- SM.getMemoryBuffer(SM.FindBufferContainingLoc(
- SMLoc::getFromPointer(Buffer.data())))
- ->getBufferStart() &&
- "CHECK-NEXT and CHECK-EMPTY can't be the first check in a file");
-
const char *FirstNewLine = nullptr;
unsigned NumNewLines = CountNumNewlinesBetween(Buffer, FirstNewLine);
return false;
// Count the number of newlines between the previous match and this one.
- assert(Buffer.data() !=
- SM.getMemoryBuffer(SM.FindBufferContainingLoc(
- SMLoc::getFromPointer(Buffer.data())))
- ->getBufferStart() &&
- "CHECK-SAME can't be the first check in a file");
-
const char *FirstNewLine = nullptr;
unsigned NumNewLines = CountNumNewlinesBetween(Buffer, FirstNewLine);
--- /dev/null
+some text
+more text
+
+RUN: FileCheck %s --check-prefix=NEXT --input-file=%s
+NEXT: {{^}}
+NEXT-NEXT: more text
+
+RUN: FileCheck %s --check-prefix=SAME --input-file=%s
+SAME: {{^}}
+SAME-SAME: some text
+
+RUN: echo "" > %t
+RUN: echo "" >> %t
+RUN: FileCheck %s --check-prefix=EMPTY --input-file=%t
+EMPTY: {{^}}
+EMPTY-EMPTY: