Skip to content

Commit 6974c78

Browse files
committed
Address review comments
1 parent efd7bd8 commit 6974c78

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

llvm/lib/FileCheck/FileCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ Pattern::parseVariable(StringRef &Str, const SourceMgr &SM) {
298298
++I;
299299

300300
if (I == Str.size())
301-
return ErrorDiagnostic::get(SM, Str,
301+
return ErrorDiagnostic::get(SM, Str.slice(I, StringRef::npos),
302302
StringRef("empty ") +
303303
(IsPseudo ? "pseudo " : "global ") +
304304
"variable name");

llvm/test/FileCheck/empty-variable-name.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ a
77
; CHECK: a[[]]
88
; CHECK-ERROR:[[DIR]]/empty-variable-name.txt:7:13: error: empty variable name
99
; CHECK-ERROR-NEXT:; CHECK: a{{\[\[\]\]}}
10-
; CHECK-ERROR-NEXT: ^
10+
; CHECK-ERROR-NEXT: ^
1111

1212
b
1313

@@ -16,9 +16,9 @@ b
1616
; RUN: --match-full-lines --strict-whitespace %s
1717

1818
; CHECK-PSEUDO: b[[@]]
19-
; CHECK-ERROR-PSEUDO:[[DIR]]/empty-variable-name.txt:18:20: error: empty pseudo variable name
19+
; CHECK-ERROR-PSEUDO:[[DIR]]/empty-variable-name.txt:18:21: error: empty pseudo variable name
2020
; CHECK-ERROR-PSEUDO-NEXT:; CHECK-PSEUDO: b{{\[\[@\]\]}}
21-
; CHECK-ERROR-PSEUDO-NEXT: ^
21+
; CHECK-ERROR-PSEUDO-NEXT: ^
2222

2323
c
2424

@@ -27,6 +27,6 @@ c
2727
; RUN: --match-full-lines --strict-whitespace %s
2828

2929
; CHECK-GLOBAL: c[[$]]
30-
; CHECK-ERROR-GLOBAL:[[DIR]]/empty-variable-name.txt:29:20: error: empty global variable name
30+
; CHECK-ERROR-GLOBAL:[[DIR]]/empty-variable-name.txt:29:21: error: empty global variable name
3131
; CHECK-ERROR-GLOBAL-NEXT:; CHECK-GLOBAL: c{{\[\[\$\]\]}}
32-
; CHECK-ERROR-GLOBAL-NEXT: ^
32+
; CHECK-ERROR-GLOBAL-NEXT: ^

0 commit comments

Comments
 (0)