Index: include/clang/Frontend/VerifyDiagnosticConsumer.h
===================================================================
--- include/clang/Frontend/VerifyDiagnosticConsumer.h	(revision 212264)
+++ include/clang/Frontend/VerifyDiagnosticConsumer.h	(working copy)
@@ -71,7 +71,10 @@
 /// \endcode
 ///
 /// The path can be absolute or relative and the same search paths will be used
-/// as for #include directives.
+/// as for #include directives.  The line number in an external file may be
+/// substituted with '*' meaning that any line number will match (useful where
+/// the included file is, for example, a system header where the actual line
+/// number may change and is not critical).
 ///
 /// The simple syntax above allows each specification to match exactly one
 /// error.  You can use the extended syntax to customize this. The extended
@@ -143,7 +146,7 @@
   class Directive {
   public:
     static Directive *create(bool RegexKind, SourceLocation DirectiveLoc,
-                             SourceLocation DiagnosticLoc,
+                             SourceLocation DiagnosticLoc, bool MatchAllLines,
                              StringRef Text, unsigned Min, unsigned Max);
   public:
     /// Constant representing n or more matches.
@@ -153,6 +156,7 @@
     SourceLocation DiagnosticLoc;
     const std::string Text;
     unsigned Min, Max;
+    bool MatchAllLines;
 
     virtual ~Directive() { }
 
@@ -165,9 +169,9 @@
 
   protected:
     Directive(SourceLocation DirectiveLoc, SourceLocation DiagnosticLoc,
-              StringRef Text, unsigned Min, unsigned Max)
+              bool MatchAllLines, StringRef Text, unsigned Min, unsigned Max)
       : DirectiveLoc(DirectiveLoc), DiagnosticLoc(DiagnosticLoc),
-        Text(Text), Min(Min), Max(Max) {
+        Text(Text), Min(Min), Max(Max), MatchAllLines(MatchAllLines) {
     assert(!DirectiveLoc.isInvalid() && "DirectiveLoc is invalid!");
     assert(!DiagnosticLoc.isInvalid() && "DiagnosticLoc is invalid!");
     }
Index: lib/Frontend/VerifyDiagnosticConsumer.cpp
===================================================================
--- lib/Frontend/VerifyDiagnosticConsumer.cpp	(revision 212264)
+++ lib/Frontend/VerifyDiagnosticConsumer.cpp	(working copy)
@@ -164,8 +164,9 @@
 class StandardDirective : public Directive {
 public:
   StandardDirective(SourceLocation DirectiveLoc, SourceLocation DiagnosticLoc,
-                    StringRef Text, unsigned Min, unsigned Max)
-    : Directive(DirectiveLoc, DiagnosticLoc, Text, Min, Max) { }
+                    bool MatchAllLines, StringRef Text, unsigned Min,
+                    unsigned Max)
+    : Directive(DirectiveLoc, DiagnosticLoc, MatchAllLines, Text, Min, Max) { }
 
   bool isValid(std::string &Error) override {
     // all strings are considered valid; even empty ones
@@ -182,8 +183,10 @@
 class RegexDirective : public Directive {
 public:
   RegexDirective(SourceLocation DirectiveLoc, SourceLocation DiagnosticLoc,
-                 StringRef Text, unsigned Min, unsigned Max, StringRef RegexStr)
-    : Directive(DirectiveLoc, DiagnosticLoc, Text, Min, Max), Regex(RegexStr) { }
+                 bool MatchAllLines, StringRef Text, unsigned Min, unsigned Max,
+                 StringRef RegexStr)
+    : Directive(DirectiveLoc, DiagnosticLoc, MatchAllLines, Text, Min, Max),
+      Regex(RegexStr) { }
 
   bool isValid(std::string &Error) override {
     if (Regex.isValid(Error))
@@ -371,6 +374,7 @@
 
     // Next optional token: @
     SourceLocation ExpectedLoc;
+    bool MatchAllLines = false;
     if (!PH.Next("@")) {
       ExpectedLoc = Pos;
     } else {
@@ -411,6 +415,10 @@
 
         if (PH.Next(Line) && Line > 0)
           ExpectedLoc = SM.translateFileLineCol(FE, Line, 1);
+        else if (PH.Next("*")) {
+          MatchAllLines = true;
+          ExpectedLoc = SM.translateFileLineCol(FE, 1, 1);
+        }
       }
 
       if (ExpectedLoc.isInvalid()) {
@@ -495,7 +503,8 @@
 
     // Construct new directive.
     std::unique_ptr<Directive> D(
-        Directive::create(RegexKind, Pos, ExpectedLoc, Text, Min, Max));
+        Directive::create(RegexKind, Pos, ExpectedLoc, MatchAllLines, Text,
+                          Min, Max));
 
     std::string Error;
     if (D->isValid(Error)) {
@@ -644,8 +653,11 @@
   llvm::raw_svector_ostream OS(Fmt);
   for (DirectiveList::iterator I = DL.begin(), E = DL.end(); I != E; ++I) {
     Directive &D = **I;
-    OS << "\n  File " << SourceMgr.getFilename(D.DiagnosticLoc)
-          << " Line " << SourceMgr.getPresumedLineNumber(D.DiagnosticLoc);
+    OS << "\n  File " << SourceMgr.getFilename(D.DiagnosticLoc);
+    if (D.MatchAllLines)
+      OS << " Line *";
+    else
+      OS << " Line " << SourceMgr.getPresumedLineNumber(D.DiagnosticLoc);
     if (D.DirectiveLoc != D.DiagnosticLoc)
       OS << " (directive at "
          << SourceMgr.getFilename(D.DirectiveLoc) << ':'
@@ -692,9 +704,11 @@
     for (unsigned i = 0; i < D.Max; ++i) {
       DiagList::iterator II, IE;
       for (II = Right.begin(), IE = Right.end(); II != IE; ++II) {
-        unsigned LineNo2 = SourceMgr.getPresumedLineNumber(II->first);
-        if (LineNo1 != LineNo2)
-          continue;
+        if (!D.MatchAllLines) {
+          unsigned LineNo2 = SourceMgr.getPresumedLineNumber(II->first);
+          if (LineNo1 != LineNo2)
+            continue;
+        }
 
         if (!IsFromSameFile(SourceMgr, D.DiagnosticLoc, II->first))
           continue;
@@ -859,10 +873,11 @@
 }
 
 Directive *Directive::create(bool RegexKind, SourceLocation DirectiveLoc,
-                             SourceLocation DiagnosticLoc, StringRef Text,
-                             unsigned Min, unsigned Max) {
+                             SourceLocation DiagnosticLoc, bool MatchAllLines,
+                             StringRef Text, unsigned Min, unsigned Max) {
   if (!RegexKind)
-    return new StandardDirective(DirectiveLoc, DiagnosticLoc, Text, Min, Max);
+    return new StandardDirective(DirectiveLoc, DiagnosticLoc, MatchAllLines,
+                                 Text, Min, Max);
 
   // Parse the directive into a regular expression.
   std::string RegexStr;
@@ -887,6 +902,6 @@
     }
   }
 
-  return new RegexDirective(DirectiveLoc, DiagnosticLoc, Text, Min, Max,
-                            RegexStr);
+  return new RegexDirective(DirectiveLoc, DiagnosticLoc, MatchAllLines, Text,
+                            Min, Max, RegexStr);
 }
Index: test/Frontend/verify2.c
===================================================================
--- test/Frontend/verify2.c	(revision 212264)
+++ test/Frontend/verify2.c	(working copy)
@@ -14,7 +14,20 @@
 
 //      CHECK: error: no expected directives found: consider use of 'expected-no-diagnostics'
 // CHECK-NEXT: error: 'error' diagnostics seen but not expected:
-// CHECK-NEXT:   Line 1: header
+// CHECK-NEXT:   Line 5: header
 // CHECK-NEXT:   Line 10: source
 // CHECK-NEXT: 3 errors generated.
 #endif
+
+#ifdef CHECK2
+// RUN: not %clang_cc1 -DCHECK2 -verify %s 2>&1 | FileCheck -check-prefix=CHECK2 %s
+
+// expected-error@verify2.h:* {{header}}
+// expected-error@verify2.h:* {{unknown}}
+
+//      CHECK2: error: 'error' diagnostics expected but not seen:
+// CHECK2-NEXT:   File {{.*}}verify2.h Line * (directive at {{.*}}verify2.c:26): unknown
+// CHECK2-NEXT: error: 'error' diagnostics seen but not expected:
+// CHECK2-NEXT:   File {{.*}}verify2.c Line 10: source
+// CHECK2-NEXT: 2 errors generated.
+#endif
Index: test/Frontend/verify2.h
===================================================================
--- test/Frontend/verify2.h	(revision 212264)
+++ test/Frontend/verify2.h	(working copy)
@@ -1,5 +1,5 @@
-#error header
-
 #if 0
 // expected-error {{should be ignored}}
 #endif
+
+#error header
