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 @@ -2079,9 +2079,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,14 +28,14 @@ ; 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 ; ALIGN-NEXT:check:2'0 ~~~~~ ; ALIGN-NEXT: 4: unicorn ; ALIGN-NEXT:check:2'0 ~~~~~~~ -; ALIGN-NEXT:check:2'1 ? possible intended match +; ALIGN-NEXT:check:2'1 ? possible intended match ; ALIGN-NEXT:>>>>>> ; ALIGN-NOT:{{.}} @@ -72,11 +72,12 @@ ; 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 +; CHK-NEXT: check:2'1 ? possible intended match ; CHK-NEXT: >>>>>> ; CHK-NOT: {{.}} @@ -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: {{.}} @@ -172,7 +176,7 @@ ; NXT2-NEXT: 2: again ; NXT2-NEXT: 3: yonder ; NXT2-NEXT: 4: world -; NXT2-NEXT: next:3 !~~~~ error: match on wrong line +; NXT2-NEXT: next:3 !~~~~ error: match on wrong line ; NXT2-NEXT: >>>>>> ; NXT2-NOT: {{.}} @@ -230,7 +234,7 @@ ; SAM2-NEXT: check:1 ^~~~~ ; SAM2-NEXT: same:2 ^~~~~ ; SAM2-NEXT: 2: again -; SAM2-NEXT: same:3 !~~~~ error: match on wrong line +; SAM2-NEXT: same:3 !~~~~ error: match on wrong line ; SAM2-NEXT: >>>>>> ; SAM2-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 ~~~~~ @@ -314,7 +319,7 @@ ; EMP2-V-NEXT: check:1 ^~~~~ ; EMP2-NEXT: 2: world ; EMP2-NEXT: 3: -; EMP2-NEXT: empty:2 ! error: match on wrong line +; EMP2-NEXT: empty:2 ! error: match on wrong line ; EMP2-NEXT: >>>>>> ; EMP2-NOT: {{.}} @@ -352,7 +357,7 @@ ; NOT-VV-NEXT: not:1 X~~~~ ; NOT-NEXT: 2: world ; NOT-VV-NEXT: not:1 ~~~~~ -; NOT-NEXT: not:2 !~~~~ error: no match expected +; NOT-NEXT: not:2 !~~~~ error: no match expected ; NOT-NEXT: 3: again ; NOT-VV-NEXT: not:1 ~~~~~ ; NOT-VV-NEXT: 4: @@ -385,7 +390,7 @@ ; NOT2-VV-NEXT: not:1 X~~~~ ; NOT2-NEXT: 2: world ; NOT2-VV-NEXT: not:1 ~~~~~ -; NOT2-NEXT: not:2 !~~~~ error: no match expected +; NOT2-NEXT: not:2 !~~~~ error: no match expected ; NOT2-NEXT: 3: again ; NOT2-V-NEXT: check:3 ^~~ ; NOT2-VV-NEXT: not:1 ~~ @@ -433,16 +438,19 @@ ; DAG: <<<<<< ; DAG-NEXT: 1: abc ; DAG-V-NEXT: dag:2 ^~~ -; DAG-VV-NEXT: dag:3'0 !~~ discard: overlaps earlier match +; DAG-VV-NEXT: dag:3'0 !~~ discard: overlaps earlier match ; DAG-NEXT: 2: def ; DAG-V-NEXT: dag:1 ^~~ -; DAG-VV-NEXT: dag:4'0 !~~ discard: overlaps earlier match +; 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: {{.}} @@ -479,17 +487,17 @@ ; DAG1L-NEXT: 1: abc def abc def ; DAG1L-V-NEXT:dag:1 ^~~ ; DAG1L-V-NEXT:dag:2 ^~ -; DAG1L-VV-NEXT:dag:3'0 !~~ discard: overlaps earlier match +; DAG1L-VV-NEXT:dag:3'0 !~~ discard: overlaps earlier match ; DAG1L-VQ-NEXT:dag:3 ^~~ ; DAG1L-VV-NEXT:dag:3'1 ^~~ -; DAG1L-VV-NEXT:dag:4'0 !~ discard: overlaps earlier match +; DAG1L-VV-NEXT:dag:4'0 !~ discard: overlaps earlier match ; DAG1L-VQ-NEXT:dag:4 ^~ ; DAG1L-VV-NEXT:dag:4'1 ^~ -; DAG1L-VV-NEXT:dag:5'0 !~~ discard: overlaps earlier match -; DAG1L-VV-NEXT:dag:5'1 !~~ discard: overlaps earlier match -; DAG1L-Q-NEXT:dag:5 X error: no match found -; DAG1L-VQ-NEXT:dag:5 X error: no match found -; DAG1L-VV-NEXT:dag:5'2 X error: no match found +; DAG1L-VV-NEXT:dag:5'0 !~~ discard: overlaps earlier match +; DAG1L-VV-NEXT:dag:5'1 !~~ discard: overlaps earlier match +; DAG1L-Q-NEXT:dag:5 X error: no match found +; DAG1L-VQ-NEXT:dag:5 X error: no match found +; DAG1L-VV-NEXT:dag:5'2 X error: no match found ; DAG1L-NEXT:>>>>>> ; DAG1L-NOT:{{.}} @@ -532,11 +540,12 @@ ; 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 +; LAB-NEXT: label:3'1 ? possible intended match ; LAB-NEXT: 4: bar ; LAB-NEXT: label:3'0 ~~~ ; LAB-NEXT: >>>>>> @@ -596,7 +605,7 @@ ; IMPNOT-V-NEXT:check:3 ^ ; IMPNOT-VV-NEXT:not:imp1 X~~~~~~~ ; IMPNOT-VV-NEXT:not:imp2 X~~~~~~~ -; IMPNOT-NEXT:not:imp3 !~~~~ error: no match expected +; IMPNOT-NEXT:not:imp3 !~~~~ error: no match expected ; IMPNOT-NEXT:>>>>>> ; IMPNOT-NOT:{{.}} @@ -619,14 +628,15 @@ ; SUBST-POS:<<<<<< ; SUBST-POS-NEXT: 1: def-match1 def-match2 ; 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: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: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:check:2'4 ? possible intended match +; 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:>>>>>> ;-------------------------------------------------- @@ -655,14 +665,14 @@ ; SUBST-NEG:<<<<<< ; SUBST-NEG-NEXT: 1: def-match1 def-nomatch ; SUBST-NEG-NEXT:not:1'0 X~~~~~~~~~~~~~~~~~~~~~ -; SUBST-NEG-NEXT:not:1'1 with "DEF_MATCH1" equal to "def-match1" -; SUBST-NEG-NEXT:not:1'2 uses undefined variable(s): "UNDEF" -; SUBST-NEG-NEXT:not:1'3 with "DEF_NOMATCH" equal to "foobar" +; SUBST-NEG-NEXT:not:1'1 with "DEF_MATCH1" equal to "def-match1" +; SUBST-NEG-NEXT:not:1'2 uses undefined variable(s): "UNDEF" +; SUBST-NEG-NEXT:not:1'3 with "DEF_NOMATCH" equal to "foobar" ; SUBST-NEG-NEXT: 2: def-match1 def-match2 ; SUBST-NEG-NEXT:not:1'0 ~~~~~~~~~~~~~~~~~~~~~ -; SUBST-NEG-NEXT:not:2'0 !~~~~~~~~~~~~~~~~~~~~ error: no match expected -; SUBST-NEG-NEXT:not:2'1 with "DEF_MATCH1" equal to "def-match1" -; SUBST-NEG-NEXT:not:2'2 with "DEF_MATCH2" equal to "def-match2" +; SUBST-NEG-NEXT:not:2'0 !~~~~~~~~~~~~~~~~~~~~ error: no match expected +; SUBST-NEG-NEXT:not:2'1 with "DEF_MATCH1" equal to "def-match1" +; SUBST-NEG-NEXT:not:2'2 with "DEF_MATCH2" equal to "def-match2" ; SUBST-NEG-NEXT: 3: END ; SUBST-NEG-NEXT:check:3 ^~~ ; SUBST-NEG-NEXT:>>>>>> @@ -697,23 +707,23 @@ ; CAPTURE-NEG:<<<<<< ; CAPTURE-NEG-NEXT: 1: strvar: foo ; CAPTURE-NEG-NEXT:check:1'0 ^~~~~~~~~~~ -; CAPTURE-NEG-NEXT:check:1'1 ^~~ captured var "STRVAR" +; CAPTURE-NEG-NEXT:check:1'1 ^~~ captured var "STRVAR" ; CAPTURE-NEG-NEXT: 2: numvar no expr: 51 ; CAPTURE-NEG-NEXT:check:2'0 ^~~~~~~~~~~~~~~~~~ -; CAPTURE-NEG-NEXT:check:2'1 ^~ captured var "NUMVAR_NO_EXPR" +; CAPTURE-NEG-NEXT:check:2'1 ^~ captured var "NUMVAR_NO_EXPR" ; CAPTURE-NEG-NEXT: 3: numvar expr: -49 ; CAPTURE-NEG-NEXT:check:3'0 ^~~~~~~~~~~~~~~~ -; CAPTURE-NEG-NEXT:check:3'1 with "%d,NUMVAR_EXPR:2-NUMVAR_NO_EXPR" equal to "-49" -; CAPTURE-NEG-NEXT:check:3'2 ^~~ captured var "NUMVAR_EXPR" +; CAPTURE-NEG-NEXT:check:3'1 with "%d,NUMVAR_EXPR:2-NUMVAR_NO_EXPR" equal to "-49" +; CAPTURE-NEG-NEXT:check:3'2 ^~~ captured var "NUMVAR_EXPR" ; CAPTURE-NEG-NEXT: 4: many: foo 100 8 bar ; CAPTURE-NEG-NEXT:check:4'0 ^~~~~~~~~~~~~~~~~~~ -; CAPTURE-NEG-NEXT:check:4'1 ^~~ captured var "VAR1" -; CAPTURE-NEG-NEXT:check:4'2 ^~~ captured var "VAR3" -; CAPTURE-NEG-NEXT:check:4'3 ^ captured var "VAR2" -; CAPTURE-NEG-NEXT:check:4'4 ^~~ captured var "VAR4" +; CAPTURE-NEG-NEXT:check:4'1 ^~~ captured var "VAR1" +; CAPTURE-NEG-NEXT:check:4'2 ^~~ captured var "VAR3" +; CAPTURE-NEG-NEXT:check:4'3 ^ captured var "VAR2" +; CAPTURE-NEG-NEXT:check:4'4 ^~~ captured var "VAR4" ; CAPTURE-NEG-NEXT: 5: var in neg match: foo -; CAPTURE-NEG-NEXT:not:5'0 !~~~~~~~~~~~~~~~~~~~~ error: no match expected -; CAPTURE-NEG-NEXT:not:5'1 !~~ captured var "VAR" +; CAPTURE-NEG-NEXT:not:5'0 !~~~~~~~~~~~~~~~~~~~~ error: no match expected +; CAPTURE-NEG-NEXT:not:5'1 !~~ captured var "VAR" ; CAPTURE-NEG-NEXT: 6: END ; CAPTURE-NEG-NEXT:check:6 ^~~ ; CAPTURE-NEG-NEXT:>>>>>> @@ -745,8 +755,8 @@ ; SUBST_NEXT:<<<<<< ; SUBST_NEXT-NEXT: 1: pre var ; SUBST_NEXT-NEXT:check:1 ^~~ -; SUBST_NEXT-NEXT:next:2'0 !~~ error: match on wrong line -; SUBST_NEXT-NEXT:next:2'1 with "VAR" equal to "var" +; SUBST_NEXT-NEXT:next:2'0 !~~ error: match on wrong line +; SUBST_NEXT-NEXT:next:2'1 with "VAR" equal to "var" ; SUBST_NEXT-NEXT:>>>>>> ;- - - - - - - - - - - - - - - - - - - - - - - - - @@ -768,8 +778,8 @@ ; SUBST_SAME-NEXT: 1: pre ; SUBST_SAME-NEXT:check:1 ^~~ ; SUBST_SAME-NEXT: 2: var -; SUBST_SAME-NEXT:same:2'0 !~~ error: match on wrong line -; SUBST_SAME-NEXT:same:2'1 with "VAR" equal to "var" +; SUBST_SAME-NEXT:same:2'0 !~~ error: match on wrong line +; SUBST_SAME-NEXT:same:2'1 with "VAR" equal to "var" ; SUBST_SAME-NEXT:>>>>>> ;- - - - - - - - - - - - - - - - - - - - - - - - - @@ -792,11 +802,11 @@ ; SUBST_DAG:<<<<<< ; SUBST_DAG-NEXT: 1: var ; SUBST_DAG-NEXT:dag:1 ^~~ -; SUBST_DAG-NEXT:dag:2'0 !~~ discard: overlaps earlier match -; SUBST_DAG-NEXT:dag:2'1 with "VAR" equal to "var" +; SUBST_DAG-NEXT:dag:2'0 !~~ discard: overlaps earlier match +; SUBST_DAG-NEXT:dag:2'1 with "VAR" equal to "var" ; SUBST_DAG-NEXT: 2: var ; SUBST_DAG-NEXT:dag:2'2 ^~~ -; SUBST_DAG-NEXT:dag:2'3 with "VAR" equal to "var" +; SUBST_DAG-NEXT:dag:2'3 with "VAR" equal to "var" ; SUBST_DAG-NEXT: 3: END ; SUBST_DAG-NEXT:check:3 ^~~ ; SUBST_DAG-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 @@ -69,7 +69,7 @@ ; C0-NEXT: 9: lab1 hello ; C0-NEXT: label:1'0 ^~~~ ; C0-NEXT: label:1'1 ^~~~ -; C0-NEXT: next:2 !~~~~ error: match on wrong line +; C0-NEXT: next:2 !~~~~ error: match on wrong line ; C1-NEXT: 10: foo1 ; C2-NEXT: 11: foo2 ; C3-NEXT: 12: foo3 @@ -89,7 +89,7 @@ ; C1-NEXT: 23: foo1 ; C0-NEXT: 24: lab2 world ; C0-NEXT: label:3 ^~~~ -; C0-NEXT: next:4 !~~~~ error: match on wrong line +; C0-NEXT: next:4 !~~~~ error: match on wrong line ; C1-NEXT: 25: foo1 ; C2-NEXT: 26: foo2 ; C3-NEXT: 27: foo3 @@ -120,41 +120,43 @@ ; 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: next:5 !~~~~ error: match on wrong line +; W5-NEXT: check:3'0 ~~~~ +; W5-NEXT: next:5 !~~~~ error: match on wrong line ;-------------------------------------------------- ; Check -dump-input-context=. 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: {{.}} diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp --- a/llvm/utils/FileCheck/FileCheck.cpp +++ b/llvm/utils/FileCheck/FileCheck.cpp @@ -693,7 +693,7 @@ // put the note right after the marker, subsequent annotations for the // same input line might appear to mark this note instead of the input // line. - for (; Col <= InputLineWidth; ++Col) + for (; Col <= InputLineWidth + Newline; ++Col) COS << ' '; COS << ' ' << Note; }