diff --git a/llvm/lib/FileCheck/FileCheck.cpp b/llvm/lib/FileCheck/FileCheck.cpp --- a/llvm/lib/FileCheck/FileCheck.cpp +++ b/llvm/lib/FileCheck/FileCheck.cpp @@ -2033,9 +2033,6 @@ PrintDiag = !Diags; } - // If the current position is at the end of a line, advance to the start of - // the next line. - Buffer = Buffer.substr(Buffer.find_first_not_of(" \t\n\r")); FileCheckDiag::MatchType MatchTy = ExpectedMatch ? FileCheckDiag::MatchNoneButExpected : FileCheckDiag::MatchNoneAndExcluded; diff --git a/llvm/test/FileCheck/dump-input-annotations.txt b/llvm/test/FileCheck/dump-input-annotations.txt --- a/llvm/test/FileCheck/dump-input-annotations.txt +++ b/llvm/test/FileCheck/dump-input-annotations.txt @@ -28,7 +28,7 @@ ; ALIGN-NEXT:<<<<<< ; ALIGN-NEXT: 1: hello world ; ALIGN-NEXT:check:1 ^~~~~ -; ALIGN-NEXT:check:2'0 X~~~~ error: no match found +; ALIGN-NEXT:check:2'0 X~~~~~ error: no match found ; ALIGN-NEXT: 2: goodbye ; ALIGN-NEXT:check:2'0 ~~~~~~~ ; ALIGN-NEXT: 3: world @@ -72,8 +72,9 @@ ; CHK: <<<<<< ; CHK-NEXT: 1: hello ; CHK-V-NEXT: check:1 ^~~~~ +; CHK-NEXT: check:2'0 X error: no match found ; CHK-NEXT: 2: again -; CHK-NEXT: check:2'0 X~~~~ error: no match found +; CHK-NEXT: check:2'0 ~~~~~ ; CHK-NEXT: 3: whirled ; CHK-NEXT: check:2'0 ~~~~~~~ ; CHK-NEXT: check:2'1 ? possible intended match @@ -113,9 +114,13 @@ ; CNT-V-NEXT: count:1'0 ^~~~ ; CNT-NEXT: 2: repete ; CNT-V-NEXT: count:1'1 ^~~~ +; CNT-Q-NEXT: count:1'0 X error: no match found +; CNT-V-NEXT: count:1'2 X error: no match found ; CNT-NEXT: 3: repeat -; CNT-Q-NEXT: count:1 X~~~~~ error: no match found -; CNT-V-NEXT: count:1'2 X~~~~~ error: no match found +; CNT-Q-NEXT: count:1'0 ~~~~~~ +; CNT-Q-NEXT: count:1'1 ? possible intended match +; CNT-V-NEXT: count:1'2 ~~~~~~ +; CNT-V-NEXT: count:1'3 ? possible intended match ; CNT-NEXT: >>>>>> ; CNT-NOT: {{.}} @@ -153,8 +158,7 @@ ; NXT-V-NEXT: check:1 ^~~~~ ; NXT-NEXT: 2: again ; NXT-V-NEXT: next:2 ^~~~~ -; NXT-NEXT: 3: -; NXT-NEXT: next:3 X error: no match found +; NXT-NEXT: next:3 X error: no match found ; NXT-NEXT: >>>>>> ; NXT-NOT: {{.}} @@ -277,8 +281,9 @@ ; EMP-V-NEXT: check:1 ^~~~~ ; EMP-NEXT: 2: ; EMP-V-NEXT: empty:2 ^ +; EMP-NEXT: empty:3 X error: no match found ; EMP-NEXT: 3: world -; EMP-NEXT: empty:3 X~~~~ error: no match found +; EMP-NEXT: empty:3 ~~~~~ ; EMP-NEXT: 4: label ; EMP-V-NEXT: label:4 ^~~~~ ; EMP-NEXT: empty:3 ~~~~~ @@ -437,12 +442,15 @@ ; DAG-NEXT: 2: def ; DAG-V-NEXT: dag:1 ^~~ ; DAG-VV-NEXT: dag:4'0 !~~ discard: overlaps earlier match +; DAG-Q-NEXT: dag:4 X error: no match found +; DAG-VQ-NEXT: dag:4 X error: no match found +; DAG-VV-NEXT: dag:4'1 X error: no match found ; DAG-NEXT: 3: abc ; DAG-VQ-NEXT: dag:3 ^~~ ; DAG-VV-NEXT: dag:3'1 ^~~ -; DAG-Q-NEXT: dag:4 X~~ error: no match found -; DAG-VQ-NEXT: dag:4 X~~ error: no match found -; DAG-VV-NEXT: dag:4'1 X~~ error: no match found +; DAG-Q-NEXT: dag:4 ~~~ +; DAG-VQ-NEXT: dag:4 ~~~ +; DAG-VV-NEXT: dag:4'1 ~~~ ; DAG-NEXT: >>>>>> ; DAG-NOT: {{.}} @@ -532,8 +540,9 @@ ; LAB-NEXT: 1: lab0 ; LAB-V-NEXT: label:1'0 ^~~~ ; LAB-V-NEXT: label:1'1 ^~~~ +; LAB-NEXT: label:3'0 X error: no match found ; LAB-NEXT: 2: foo -; LAB-NEXT: label:3'0 X~~ error: no match found +; LAB-NEXT: label:3'0 ~~~ ; LAB-NEXT: 3: lab1 ; LAB-NEXT: label:3'0 ~~~~ ; LAB-NEXT: label:3'1 ? possible intended match @@ -621,11 +630,12 @@ ; SUBST-POS-NEXT:check:1'0 ^~~~~~~~~~~~~~~~~~~~~ ; SUBST-POS-NEXT:check:1'1 with "DEF_MATCH1" equal to "def-match1" ; SUBST-POS-NEXT:check:1'2 with "DEF_MATCH2" equal to "def-match2" -; SUBST-POS-NEXT: 2: def-match1 def-nomatch -; SUBST-POS-NEXT:check:2'0 X~~~~~~~~~~~~~~~~~~~~~ error: no match found +; SUBST-POS-NEXT:check:2'0 X error: no match found ; SUBST-POS-NEXT:check:2'1 with "DEF_MATCH1" equal to "def-match1" ; SUBST-POS-NEXT:check:2'2 uses undefined variable(s): "UNDEF" ; SUBST-POS-NEXT:check:2'3 with "DEF_NOMATCH" equal to "foobar" +; SUBST-POS-NEXT: 2: def-match1 def-nomatch +; SUBST-POS-NEXT:check:2'0 ~~~~~~~~~~~~~~~~~~~~~~ ; SUBST-POS-NEXT:check:2'4 ? possible intended match ; SUBST-POS-NEXT:>>>>>> diff --git a/llvm/test/FileCheck/dump-input-context.txt b/llvm/test/FileCheck/dump-input-context.txt --- a/llvm/test/FileCheck/dump-input-context.txt +++ b/llvm/test/FileCheck/dump-input-context.txt @@ -120,40 +120,42 @@ ; W5-NEXT: label:1'0 ^~~~ ; W5-NEXT: label:1'1 ^~~~ ; W5-NEXT: check:2 ^~~~~ +; W5-NEXT: check:3'0 X error: no match found ; W5-NEXT: 10: foo1 -; W5-NEXT: check:3 X~~~ error: no match found +; W5-NEXT: check:3'0 ~~~~ +; W5-NEXT: check:3'1 ? possible intended match ; W5-NEXT: 11: foo2 -; W5-NEXT: check:3 ~~~~ +; W5-NEXT: check:3'0 ~~~~ ; W5-NEXT: 12: foo3 -; W5-NEXT: check:3 ~~~~ +; W5-NEXT: check:3'0 ~~~~ ; W5-NEXT: 13: foo4 -; W5-NEXT: check:3 ~~~~ +; W5-NEXT: check:3'0 ~~~~ ; W5-NEXT: 14: foo5 -; W5-NEXT: check:3 ~~~~ +; W5-NEXT: check:3'0 ~~~~ ; W5-NEXT: 15: foo6 -; W5-NEXT: check:3 ~~~~ +; W5-NEXT: check:3'0 ~~~~ ; W6-NEXT: 16: foo7 -; W6-NEXT: check:3 ~~~~ +; W6-NEXT: check:3'0 ~~~~ ; WM-NEXT: . ; WM-NEXT: . ; WM-NEXT: . ; W6-NEXT: 17: foo7 -; W6-NEXT: check:3 ~~~~ +; W6-NEXT: check:3'0 ~~~~ ; W6-NEXT: 18: foo6 -; W6-NEXT: check:3 ~~~~ +; W6-NEXT: check:3'0 ~~~~ ; W5-NEXT: 19: foo5 -; W5-NEXT: check:3 ~~~~ +; W5-NEXT: check:3'0 ~~~~ ; W5-NEXT: 20: foo4 -; W5-NEXT: check:3 ~~~~ +; W5-NEXT: check:3'0 ~~~~ ; W5-NEXT: 21: foo3 -; W5-NEXT: check:3 ~~~~ +; W5-NEXT: check:3'0 ~~~~ ; W5-NEXT: 22: foo2 -; W5-NEXT: check:3 ~~~~ +; W5-NEXT: check:3'0 ~~~~ ; W5-NEXT: 23: foo1 -; W5-NEXT: check:3 ~~~~ +; W5-NEXT: check:3'0 ~~~~ ; W5-NEXT: 24: lab2 world ; W5-NEXT: label:4 ^~~~ -; W5-NEXT: check:3 ~~~~ +; W5-NEXT: check:3'0 ~~~~ ; W5-NEXT: next:5 !~~~~ error: match on wrong line ;-------------------------------------------------- diff --git a/llvm/test/FileCheck/dump-input-enable.txt b/llvm/test/FileCheck/dump-input-enable.txt --- a/llvm/test/FileCheck/dump-input-enable.txt +++ b/llvm/test/FileCheck/dump-input-enable.txt @@ -248,6 +248,8 @@ ; DUMP-ERR-NEXT: <<<<<< ; DUMP-ERR-NEXT: 1: hello ; DUMP-ERR-V-NEXT: check:1 ^~~~~ +; DUMP-ERR-NEXT: next:2'0 X error: no match found ; DUMP-ERR-NEXT: 2: whirled -; DUMP-ERR-NEXT: next:2 X~~~~~~ error: no match found +; DUMP-ERR-NEXT: next:2'0 ~~~~~~~ +; DUMP-ERR-NEXT: next:2'1 ? possible intended match ; DUMP-ERR-NEXT: >>>>>> diff --git a/llvm/test/FileCheck/dump-input-filter.txt b/llvm/test/FileCheck/dump-input-filter.txt --- a/llvm/test/FileCheck/dump-input-filter.txt +++ b/llvm/test/FileCheck/dump-input-filter.txt @@ -68,8 +68,9 @@ ; ALL-NEXT: 11: foo9 ; ALL-NEXT: 12: hello ; ALL-NEXT: check:2 ^~~~~ +; ALL-NEXT: check:3'0 X error: no match found ; ALL-NEXT: 13: foo0 -; ALL-NEXT: check:3'0 X~~~ error: no match found +; ALL-NEXT: check:3'0 ~~~~ ; ALL-NEXT: 14: foo1 ; ALL-NEXT: check:3'0 ~~~~ ; ALL-NEXT: 15: foo2 @@ -127,8 +128,9 @@ ; ANNOTATION-FULL-NEXT: 11: foo9 ; ANNOTATION-FULL-NEXT: 12: hello ; ANNOTATION-FULL-NEXT: check:2 ^~~~~ +; ANNOTATION-FULL-NEXT: check:3'0 X error: no match found ; ANNOTATION-FULL-NEXT: 13: foo0 -; ANNOTATION-FULL-NEXT: check:3'0 X~~~ error: no match found +; ANNOTATION-FULL-NEXT: check:3'0 ~~~~ ; ANNOTATION-FULL-NEXT: 14: foo1 ; ANNOTATION-FULL-NEXT: check:3'0 ~~~~ ; ANNOTATION-FULL-NEXT: 15: foo2 @@ -186,11 +188,10 @@ ; ANNOTATION-NEXT: 11: foo9 ; ANNOTATION-NEXT: 12: hello ; ANNOTATION-NEXT: check:2 ^~~~~ +; ANNOTATION-NEXT: check:3'0 X error: no match found ; ANNOTATION-NEXT: 13: foo0 -; ANNOTATION-NEXT: check:3'0 X~~~ error: no match found -; ANNOTATION-NEXT: 14: foo1 ; ANNOTATION-NEXT: check:3'0 ~~~~ -; ANNOTATION-NEXT: 15: foo2 +; ANNOTATION-NEXT: 14: foo1 ; ANNOTATION-NEXT: check:3'0 ~~~~ ; ANNOTATION-NEXT: . ; ANNOTATION-NEXT: . @@ -215,14 +216,14 @@ ; ERROR-NEXT: . ; ERROR-NEXT: . ; ERROR-NEXT: . +; ERROR-NEXT: 10: foo8 ; ERROR-NEXT: 11: foo9 ; ERROR-NEXT: 12: hello ; ERROR-NEXT: check:2 ^~~~~ +; ERROR-NEXT: check:3'0 X error: no match found ; ERROR-NEXT: 13: foo0 -; ERROR-NEXT: check:3'0 X~~~ error: no match found -; ERROR-NEXT: 14: foo1 ; ERROR-NEXT: check:3'0 ~~~~ -; ERROR-NEXT: 15: foo2 +; ERROR-NEXT: 14: foo1 ; ERROR-NEXT: check:3'0 ~~~~ ; ERROR-NEXT: . ; ERROR-NEXT: . @@ -422,4 +423,4 @@ ; RUN: | FileCheck %s -match-full-lines -check-prefixes=NEXT-ERR ; NEXT-ERR: 3: bar -; NEXT-ERR-NEXT: next:2 !~~ error: match on wrong line \ No newline at end of file +; NEXT-ERR-NEXT: next:2 !~~ error: match on wrong line diff --git a/llvm/test/FileCheck/numeric-expression.txt b/llvm/test/FileCheck/numeric-expression.txt --- a/llvm/test/FileCheck/numeric-expression.txt +++ b/llvm/test/FileCheck/numeric-expression.txt @@ -366,12 +366,12 @@ UNDEF-USE-MSG: numeric-expression.txt:[[#@LINE-1]]:17: error: {{U}}NDEF-USE-NEXT: expected string not found in input UNDEF-USE-MSG-NEXT: {{U}}NDEF-USE-NEXT: UNDEFVAR: {{\[\[#UNDEFVAR1\+UNDEFVAR2\]\]}} UNDEF-USE-MSG-NEXT: {{^}} ^{{$}} -UNDEF-USE-MSG-NEXT: numeric-expression.txt:[[#@LINE-6]]:1: note: scanning from here -UNDEF-USE-MSG-NEXT: UNDEFVAR: 11 -UNDEF-USE-MSG-NEXT: {{^}}^{{$}} -UNDEF-USE-MSG-NEXT: numeric-expression.txt:[[#@LINE-9]]:1: note: uses undefined variable(s): "UNDEFVAR1" "UNDEFVAR2" -UNDEF-USE-MSG-NEXT: UNDEFVAR: 11 -UNDEF-USE-MSG-NEXT: {{^}}^{{$}} +UNDEF-USE-MSG-NEXT: numeric-expression.txt:[[#@LINE-7]]:14: note: scanning from here +UNDEF-USE-MSG-NEXT: UNDEF VAR USE +UNDEF-USE-MSG-NEXT: {{^}} ^{{$}} +UNDEF-USE-MSG-NEXT: numeric-expression.txt:[[#@LINE-10]]:14: note: uses undefined variable(s): "UNDEFVAR1" "UNDEFVAR2" +UNDEF-USE-MSG-NEXT: UNDEF VAR USE +UNDEF-USE-MSG-NEXT: {{^}} ^{{$}} ; Numeric expression with unsupported operator. RUN: %ProtectFileCheckOutput \ diff --git a/llvm/test/FileCheck/verbose.txt b/llvm/test/FileCheck/verbose.txt --- a/llvm/test/FileCheck/verbose.txt +++ b/llvm/test/FileCheck/verbose.txt @@ -51,9 +51,9 @@ VV-NEXT: verbose.txt:[[@LINE-17]]:12: remark: {{C}}HECK-NOT: excluded string not found in input VV-NEXT: {{C}}HECK-NOT: raboof{{$}} VV-NEXT: {{^}} ^{{$}} -VV-NEXT: verbose.txt:[[@LINE-22]]:1: note: scanning from here -VV-NEXT: {{^}}bar{{$}} -VV-NEXT: {{^}}^{{$}} +VV-NEXT: verbose.txt:[[@LINE-23]]:4: note: scanning from here +VV-NEXT: {{^}}foo{{$}} +VV-NEXT: {{^}} ^{{$}} STRVAR=foobar STRVAR:foobar @@ -109,9 +109,9 @@ VV-NEXT: verbose.txt:[[#@LINE-23]]:12: remark: {{C}}HECK-NOT: excluded string not found in input VV-NEXT: {{C}}HECK-NOT: {{[[][[]#NUMVAR [+] 1[]][]]$}} VV-NEXT: {{^}} ^{{$}} -VV-NEXT: verbose.txt:[[#@LINE-28]]:1: note: scanning from here -VV-NEXT: {{^}}NUMVAR - 1:41{{$}} -VV-NEXT: {{^}}^{{$}} +VV-NEXT: verbose.txt:[[#@LINE-29]]:10: note: scanning from here +VV-NEXT: {{^}}NUMVAR=42{{$}} +VV-NEXT: {{^}} ^{{$}} before empty @@ -191,9 +191,9 @@ VV-NEXT: verbose.txt:[[@LINE-16]]:12: remark: {{C}}HECK-NOT: excluded string not found in input VV-NEXT: {{C}}HECK-NOT: {{[{][{]z[}][}]yx$}} VV-NEXT: {{^}} ^{{$}} -VV-NEXT: verbose.txt:[[@LINE-20]]:1: note: scanning from here -VV-NEXT: {{^C}}HECK: xyz{{$}} -VV-NEXT: {{^}}^{{$}} +VV-NEXT: verbose.txt:[[@LINE-21]]:4: note: scanning from here +VV-NEXT: {{^}}xyz{{$}} +VV-NEXT: {{^}} ^{{$}} QUIET-NOT: {{.}} V-NOT: {{.}}