Skip to content

Commit

Permalink
when emitting errors about CHECK-NEXT directives, show the line that the
Browse files Browse the repository at this point in the history
CHECK-NEXT is on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79164 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lattner committed Aug 16, 2009
1 parent 5c1c208 commit 0b2353f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions utils/FileCheck/FileCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,19 +325,23 @@ int main(int argc, char **argv) {

unsigned NumNewLines = CountNumNewlinesBetween(LastMatch, Ptr);
if (NumNewLines == 0) {
SM.PrintMessage(SMLoc::getFromPointer(Ptr),
SM.PrintMessage(CheckStr.Loc,
CheckPrefix+"-NEXT: is on the same line as previous match",
"error");
SM.PrintMessage(SMLoc::getFromPointer(Ptr),
"'next' match was here", "note");
SM.PrintMessage(SMLoc::getFromPointer(LastMatch),
"previous match was here", "note");
return 1;
}

if (NumNewLines != 1) {
SM.PrintMessage(SMLoc::getFromPointer(Ptr),
SM.PrintMessage(CheckStr.Loc,
CheckPrefix+
"-NEXT: is not on the line after the previous match",
"error");
SM.PrintMessage(SMLoc::getFromPointer(Ptr),
"'next' match was here", "note");
SM.PrintMessage(SMLoc::getFromPointer(LastMatch),
"previous match was here", "note");
return 1;
Expand Down

0 comments on commit 0b2353f

Please sign in to comment.