r179677 - Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Apr 17 14:00:05 PDT 2013


Thanks!

On 17 April 2013 04:06, Andy Gibbs <andyg1001 at hotmail.co.uk> wrote:
> Author: andyg
> Date: Wed Apr 17 03:06:46 2013
> New Revision: 179677
>
> URL: http://llvm.org/viewvc/llvm-project?rev=179677&view=rev
> Log:
> Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.
>
> VerifyDiagnosticConsumer previously would not check that the diagnostic and
> its matching directive referenced the same source file.  Common practice was
> to create directives that referenced other files but only by line number,
> and this led to problems such as when the file containing the directive
> didn't have enough lines to match the location of the diagnostic in the
> other file, leading to bizarre file formatting and other oddities.
>
> This patch causes VerifyDiagnosticConsumer to match source files as well as
> line numbers.  Therefore, a new syntax is made available for directives, for
> example:
>
> // expected-error at file:line {{diagnostic message}}
>
> This extends the @line feature where "file" is the file where the diagnostic
> is generated.  The @line syntax is still available and uses the current file
> for the diagnostic.  "file" can be specified either as a relative or absolute
> path - although the latter has less usefulness, I think!  The #include search
> paths will be used to locate the file and if it is not found an error will be
> generated.
>
> The new check is not optional: if the directive is in a different file to the
> diagnostic, the file must be specified.  Therefore, a number of test-cases
> have been updated with regard to this.
>
> This closes out PR15613.
>
> Modified:
>     cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
>     cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h
>     cfe/trunk/lib/Frontend/VerifyDiagnosticConsumer.cpp
>     cfe/trunk/test/ASTMerge/function.c
>     cfe/trunk/test/Analysis/diagnostics/explicit-suppression.cpp
>     cfe/trunk/test/Frontend/verify.c
>     cfe/trunk/test/Misc/warn-in-system-header.c
>     cfe/trunk/test/Modules/auto-module-import.m
>     cfe/trunk/test/Modules/decldef.m
>     cfe/trunk/test/Modules/decldef.mm
>     cfe/trunk/test/Modules/diamond-pch.c
>     cfe/trunk/test/Modules/diamond.c
>     cfe/trunk/test/Modules/linkage-merge.cpp
>     cfe/trunk/test/Modules/linkage-merge.m
>     cfe/trunk/test/Modules/lookup.cpp
>     cfe/trunk/test/Modules/lookup.m
>     cfe/trunk/test/Modules/macros.c
>     cfe/trunk/test/Modules/method_pool.m
>     cfe/trunk/test/Modules/module-private.cpp
>     cfe/trunk/test/Modules/namespaces.cpp
>     cfe/trunk/test/Modules/normal-module-map.cpp
>     cfe/trunk/test/Modules/objc-categories.m
>     cfe/trunk/test/Modules/on-demand-build.m
>     cfe/trunk/test/Modules/redecl-merge.m
>     cfe/trunk/test/Modules/subframeworks.m
>     cfe/trunk/test/PCH/cxx-using.cpp
>     cfe/trunk/test/PCH/cxx11-statement-attributes.cpp
>     cfe/trunk/test/PCH/functions.c
>     cfe/trunk/test/PCH/method_pool.m
>     cfe/trunk/test/PCH/nonvisible-external-defs.c
>     cfe/trunk/test/PCH/reloc.c
>     cfe/trunk/test/PCH/tentative-defs.c
>     cfe/trunk/test/PCH/typo.cpp
>     cfe/trunk/test/PCH/typo.m
>     cfe/trunk/test/Sema/pragma-arc-cf-code-audited.c
>     cfe/trunk/test/SemaObjC/arc-system-header.m
>     cfe/trunk/test/SemaObjCXX/arc-system-header.mm
>
> Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td (original)
> +++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Wed Apr 17 03:06:46 2013
> @@ -67,6 +67,8 @@ def warn_fe_serialized_diag_failure : Wa
>
>  def err_verify_missing_line : Error<
>      "missing or invalid line number following '@' in expected %0">;
> +def err_verify_missing_file : Error<
> +    "file '%0' could not be located in expected %1">;
>  def err_verify_invalid_range : Error<
>      "invalid range following '-' in expected %0">;
>  def err_verify_missing_start : Error<
>
> Modified: cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h (original)
> +++ cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h Wed Apr 17 03:06:46 2013
> @@ -61,6 +61,18 @@ class FileEntry;
>  /// The line number may be absolute (as above), or relative to the current
>  /// line by prefixing the number with either '+' or '-'.
>  ///
> +/// If the diagnostic is generated in a separate file, for example in a shared
> +/// header file, it may be beneficial to be able to declare the file in which
> +/// the diagnostic will appear, rather than placing the expected-* directive in
> +/// the actual file itself.  This can be done using the following syntax:
> +///
> +/// \code
> +///   // expected-error at path/include.h:15 {{error message}}
> +/// \endcode
> +///
> +/// The path can be absolute or relative and the same search paths will be used
> +/// as for #include directives.
> +///
>  /// The simple syntax above allows each specification to match exactly one
>  /// error.  You can use the extended syntax to customize this. The extended
>  /// syntax is "expected-<type> <n> {{diag text}}", where \<type> is one of
>
> Modified: cfe/trunk/lib/Frontend/VerifyDiagnosticConsumer.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/VerifyDiagnosticConsumer.cpp?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Frontend/VerifyDiagnosticConsumer.cpp (original)
> +++ cfe/trunk/lib/Frontend/VerifyDiagnosticConsumer.cpp Wed Apr 17 03:06:46 2013
> @@ -278,8 +278,10 @@ private:
>  ///
>  /// Returns true if any valid directives were found.
>  static bool ParseDirective(StringRef S, ExpectedData *ED, SourceManager &SM,
> -                           SourceLocation Pos, DiagnosticsEngine &Diags,
> +                           Preprocessor *PP, SourceLocation Pos,
>                             VerifyDiagnosticConsumer::DirectiveStatus &Status) {
> +  DiagnosticsEngine &Diags = PP ? PP->getDiagnostics() : SM.getDiagnostics();
> +
>    // A single comment may contain multiple directives.
>    bool FoundDirective = false;
>    for (ParseHelper PH(S); !PH.Done();) {
> @@ -353,10 +355,30 @@ static bool ParseDirective(StringRef S,
>            else ExpectedLine -= Line;
>            ExpectedLoc = SM.translateLineCol(SM.getFileID(Pos), ExpectedLine, 1);
>          }
> -      } else {
> +      } else if (PH.Next(Line)) {
>          // Absolute line number.
> -        if (PH.Next(Line) && Line > 0)
> +        if (Line > 0)
>            ExpectedLoc = SM.translateLineCol(SM.getFileID(Pos), Line, 1);
> +      } else if (PP && PH.Search(":")) {
> +        // Specific source file.
> +        StringRef Filename(PH.C, PH.P-PH.C);
> +        PH.Advance();
> +
> +        // Lookup file via Preprocessor, like a #include.
> +        const DirectoryLookup *CurDir;
> +        const FileEntry *FE = PP->LookupFile(Filename, false, NULL, CurDir,
> +                                             NULL, NULL, 0);
> +        if (!FE) {
> +          Diags.Report(Pos.getLocWithOffset(PH.C-PH.Begin),
> +                       diag::err_verify_missing_file) << Filename << KindStr;
> +          continue;
> +        }
> +
> +        if (SM.translateFile(FE).isInvalid())
> +          SM.createFileID(FE, Pos, SrcMgr::C_User);
> +
> +        if (PH.Next(Line) && Line > 0)
> +          ExpectedLoc = SM.translateFileLineCol(FE, Line, 1);
>        }
>
>        if (ExpectedLoc.isInvalid()) {
> @@ -465,7 +487,7 @@ bool VerifyDiagnosticConsumer::HandleCom
>    // Fold any "\<EOL>" sequences
>    size_t loc = C.find('\\');
>    if (loc == StringRef::npos) {
> -    ParseDirective(C, &ED, SM, CommentBegin, PP.getDiagnostics(), Status);
> +    ParseDirective(C, &ED, SM, &PP, CommentBegin, Status);
>      return false;
>    }
>
> @@ -495,7 +517,7 @@ bool VerifyDiagnosticConsumer::HandleCom
>    }
>
>    if (!C2.empty())
> -    ParseDirective(C2, &ED, SM, CommentBegin, PP.getDiagnostics(), Status);
> +    ParseDirective(C2, &ED, SM, &PP, CommentBegin, Status);
>    return false;
>  }
>
> @@ -530,8 +552,7 @@ static bool findDirectives(SourceManager
>      if (Comment.empty()) continue;
>
>      // Find first directive.
> -    if (ParseDirective(Comment, 0, SM, Tok.getLocation(),
> -                       SM.getDiagnostics(), Status))
> +    if (ParseDirective(Comment, 0, SM, 0, Tok.getLocation(), Status))
>        return true;
>    }
>    return false;
> @@ -551,8 +572,13 @@ static unsigned PrintUnexpected(Diagnost
>    for (const_diag_iterator I = diag_begin, E = diag_end; I != E; ++I) {
>      if (I->first.isInvalid() || !SourceMgr)
>        OS << "\n  (frontend)";
> -    else
> -      OS << "\n  Line " << SourceMgr->getPresumedLineNumber(I->first);
> +    else {
> +      OS << "\n ";
> +      if (const FileEntry *File = SourceMgr->getFileEntryForID(
> +                                                SourceMgr->getFileID(I->first)))
> +        OS << " File " << File->getName();
> +      OS << " Line " << SourceMgr->getPresumedLineNumber(I->first);
> +    }
>      OS << ": " << I->second;
>    }
>
> @@ -572,11 +598,12 @@ static unsigned PrintExpected(Diagnostic
>    llvm::raw_svector_ostream OS(Fmt);
>    for (DirectiveList::iterator I = DL.begin(), E = DL.end(); I != E; ++I) {
>      Directive &D = **I;
> -    OS << "\n  Line " << SourceMgr.getPresumedLineNumber(D.DiagnosticLoc);
> +    OS << "\n  File " << SourceMgr.getFilename(D.DiagnosticLoc)
> +          << " Line " << SourceMgr.getPresumedLineNumber(D.DiagnosticLoc);
>      if (D.DirectiveLoc != D.DiagnosticLoc)
>        OS << " (directive at "
> -         << SourceMgr.getFilename(D.DirectiveLoc) << ":"
> -         << SourceMgr.getPresumedLineNumber(D.DirectiveLoc) << ")";
> +         << SourceMgr.getFilename(D.DirectiveLoc) << ':'
> +         << SourceMgr.getPresumedLineNumber(D.DirectiveLoc) << ')';
>      OS << ": " << D.Text;
>    }
>
> @@ -585,6 +612,22 @@ static unsigned PrintExpected(Diagnostic
>    return DL.size();
>  }
>
> +/// \brief Determine whether two source locations come from the same file.
> +static bool IsFromSameFile(SourceManager &SM, SourceLocation DirectiveLoc,
> +                           SourceLocation DiagnosticLoc) {
> +  while (DiagnosticLoc.isMacroID())
> +    DiagnosticLoc = SM.getImmediateMacroCallerLoc(DiagnosticLoc);
> +
> +  if (SM.isFromSameFile(DirectiveLoc, DiagnosticLoc))
> +    return true;
> +
> +  const FileEntry *DiagFile = SM.getFileEntryForID(SM.getFileID(DiagnosticLoc));
> +  if (!DiagFile && SM.isFromMainFile(DirectiveLoc))
> +    return true;
> +
> +  return (DiagFile == SM.getFileEntryForID(SM.getFileID(DirectiveLoc)));
> +}
> +
>  /// CheckLists - Compare expected to seen diagnostic lists and return the
>  /// the difference between them.
>  ///
> @@ -607,6 +650,9 @@ static unsigned CheckLists(DiagnosticsEn
>          if (LineNo1 != LineNo2)
>            continue;
>
> +        if (!IsFromSameFile(SourceMgr, D.DiagnosticLoc, II->first))
> +          continue;
> +
>          const std::string &RightText = II->second;
>          if (D.match(RightText))
>            break;
>
> Modified: cfe/trunk/test/ASTMerge/function.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ASTMerge/function.c?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/ASTMerge/function.c (original)
> +++ cfe/trunk/test/ASTMerge/function.c Wed Apr 17 03:06:46 2013
> @@ -9,7 +9,7 @@
>  // CHECK: function1.c:4:6: note: declared here with type 'void (void)'
>  // CHECK: 2 errors generated
>
> -// expected-error at 3 {{external function 'f1' declared with incompatible types}}
> -// expected-note at 2 {{declared here}}
> -// expected-error at 5 {{external function 'f3' declared with incompatible types}}
> -// expected-note at 4 {{declared here}}
> +// expected-error at Inputs/function2.c:3 {{external function 'f1' declared with incompatible types}}
> +// expected-note at Inputs/function1.c:2 {{declared here}}
> +// expected-error at Inputs/function2.c:5 {{external function 'f3' declared with incompatible types}}
> +// expected-note at Inputs/function1.c:4 {{declared here}}
>
> Modified: cfe/trunk/test/Analysis/diagnostics/explicit-suppression.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/diagnostics/explicit-suppression.cpp?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Analysis/diagnostics/explicit-suppression.cpp (original)
> +++ cfe/trunk/test/Analysis/diagnostics/explicit-suppression.cpp Wed Apr 17 03:06:46 2013
> @@ -12,69 +12,6 @@ void clang_analyzer_eval(bool);
>  void testCopyNull(int *I, int *E) {
>    std::copy(I, E, (int *)0);
>  #ifndef SUPPRESSED
> -  // This line number comes from system-header-simulator-cxx.h.
> -  // expected-warning at 79 {{Dereference of null pointer}}
> +  // expected-warning at ../Inputs/system-header-simulator-cxx.h:80 {{Dereference of null pointer}}
>  #endif
>  }
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -
> -// PR15613: expected-* can't refer to diagnostics in other source files.
> -// The current implementation only matches line numbers, but has an upper limit
> -// of the number of lines in the main source file.
>
> Modified: cfe/trunk/test/Frontend/verify.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/verify.c?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Frontend/verify.c (original)
> +++ cfe/trunk/test/Frontend/verify.c Wed Apr 17 03:06:46 2013
> @@ -124,3 +124,19 @@ unexpected b; // expected-error at 33 1-1 {
>  // CHECK7-NEXT:   Line 2: 2
>  // CHECK7-NEXT: 2 errors generated.
>  #endif
> +
> +#ifdef TEST8
> +// RUN: %clang_cc1 -DTEST8 -verify %s 2>&1 | FileCheck -check-prefix=CHECK8 %s
> +
> +// expected-warning at nonexistant-file:1 {{ }}
> +// expected-error at -1 {{file 'nonexistant-file' could not be located}}
> +
> +// expected-warning at verify-directive.h: {{ }}
> +// expected-error at -1 {{missing or invalid line number}}
> +
> +// expected-warning at verify-directive.h:1 {{diagnostic}}
> +
> +//      CHECK8: error: 'warning' diagnostics expected but not seen:
> +// CHECK8-NEXT:   File {{.*}}verify-directive.h Line 1 (directive at {{.*}}verify.c:137): diagnostic
> +// CHECK8-NEXT: 1 error generated.
> +#endif
>
> Modified: cfe/trunk/test/Misc/warn-in-system-header.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/warn-in-system-header.c?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Misc/warn-in-system-header.c (original)
> +++ cfe/trunk/test/Misc/warn-in-system-header.c Wed Apr 17 03:06:46 2013
> @@ -1,4 +1,4 @@
>  // RUN: %clang_cc1 -isystem %S %s -fsyntax-only -verify
>
>  #include <warn-in-system-header.h>
> -// expected-warning {{the cake is a lie}}
> +// expected-warning at warn-in-system-header.h:4 {{the cake is a lie}}
>
> Modified: cfe/trunk/test/Modules/auto-module-import.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/auto-module-import.m?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/auto-module-import.m (original)
> +++ cfe/trunk/test/Modules/auto-module-import.m Wed Apr 17 03:06:46 2013
> @@ -1,10 +1,10 @@
> -// other file: expected-note{{'no_umbrella_A_private' declared here}}
> -
>  // RUN: rm -rf %t
>  // RUN: %clang_cc1 -Wauto-import -fmodules-cache-path=%t -fmodules -F %S/Inputs %s -verify
>
>  #include <DependsOnModule/DependsOnModule.h> // expected-warning{{treating #include as an import of module 'DependsOnModule'}}
>
> +// expected-note at Inputs/NoUmbrella.framework/PrivateHeaders/A_Private.h:1{{'no_umbrella_A_private' declared here}}
> +
>  #ifdef MODULE_H_MACRO
>  #  error MODULE_H_MACRO should have been hidden
>  #endif
>
> Modified: cfe/trunk/test/Modules/decldef.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/decldef.m?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/decldef.m (original)
> +++ cfe/trunk/test/Modules/decldef.m Wed Apr 17 03:06:46 2013
> @@ -1,8 +1,7 @@
>  // RUN: rm -rf %t
>  // RUN: %clang_cc1 -fmodules -fobjc-arc -I %S/Inputs -fmodules-cache-path=%t %s -verify
>
> -
> -// In other file: expected-note {{previous definition is here}}
> +// expected-note at Inputs/def.h:5 {{previous definition is here}}
>
>  @class Def;
>  Def *def;
>
> Modified: cfe/trunk/test/Modules/decldef.mm
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/decldef.mm?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/decldef.mm (original)
> +++ cfe/trunk/test/Modules/decldef.mm Wed Apr 17 03:06:46 2013
> @@ -1,8 +1,7 @@
>  // RUN: rm -rf %t
>  // RUN: %clang_cc1 -fmodules -fobjc-arc -I %S/Inputs -fmodules-cache-path=%t %s -verify
>
> -
> -// In other file: expected-note {{previous definition is here}}
> +// expected-note at Inputs/def.h:5 {{previous definition is here}}
>
>  @class Def;
>  Def *def;
>
> Modified: cfe/trunk/test/Modules/diamond-pch.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/diamond-pch.c?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/diamond-pch.c (original)
> +++ cfe/trunk/test/Modules/diamond-pch.c Wed Apr 17 03:06:46 2013
> @@ -1,14 +1,20 @@
> -
> -
> -
> -// in diamond-bottom.h: expected-note{{passing argument to parameter 'x' here}}
> +// RUN: rm -rf %t
> +// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_top %S/Inputs/module.map
> +// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_left %S/Inputs/module.map
> +// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_right %S/Inputs/module.map
> +// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_bottom %S/Inputs/module.map
> +// RUN: %clang_cc1 -fmodules -x objective-c -emit-pch -fmodules-cache-path=%t -o %t.pch %S/Inputs/diamond.h
> +// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -include-pch %t.pch %s -verify
> +// FIXME: When we have a syntax for modules in C, use that.
>
>  void test_diamond(int i, float f, double d, char c) {
>    top(&i);
>    left(&f);
>    right(&d);
>    bottom(&c);
> -  bottom(&d); // expected-warning{{incompatible pointer types passing 'double *' to parameter of type 'char *'}}
> +  bottom(&d);
> +  // expected-warning at -1{{incompatible pointer types passing 'double *' to parameter of type 'char *'}}
> +  // expected-note at Inputs/diamond_bottom.h:4{{passing argument to parameter 'x' here}}
>
>    // Names in multiple places in the diamond.
>    top_left(&c);
> @@ -17,12 +23,3 @@ void test_diamond(int i, float f, double
>    struct left_and_right lr;
>    lr.left = 17;
>  }
> -
> -// RUN: rm -rf %t
> -// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_top %S/Inputs/module.map
> -// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_left %S/Inputs/module.map
> -// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_right %S/Inputs/module.map
> -// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_bottom %S/Inputs/module.map
> -// RUN: %clang_cc1 -fmodules -x objective-c -emit-pch -fmodules-cache-path=%t -o %t.pch %S/Inputs/diamond.h
> -// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -include-pch %t.pch %s -verify
> -// FIXME: When we have a syntax for modules in C, use that.
>
> Modified: cfe/trunk/test/Modules/diamond.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/diamond.c?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/diamond.c (original)
> +++ cfe/trunk/test/Modules/diamond.c Wed Apr 17 03:06:46 2013
> @@ -1,7 +1,10 @@
> -
> -
> -
> -// in diamond-bottom.h: expected-note{{passing argument to parameter 'x' here}}
> +// RUN: rm -rf %t
> +// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_top %S/Inputs/module.map
> +// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_left %S/Inputs/module.map
> +// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_right %S/Inputs/module.map
> +// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_bottom %S/Inputs/module.map
> +// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t %s -verify
> +// FIXME: When we have a syntax for modules in C, use that.
>
>  @import diamond_bottom;
>
> @@ -10,7 +13,9 @@ void test_diamond(int i, float f, double
>    left(&f);
>    right(&d);
>    bottom(&c);
> -  bottom(&d); // expected-warning{{incompatible pointer types passing 'double *' to parameter of type 'char *'}}
> +  bottom(&d);
> +  // expected-warning at -1{{incompatible pointer types passing 'double *' to parameter of type 'char *'}}
> +  // expected-note at Inputs/diamond_bottom.h:4{{passing argument to parameter 'x' here}}
>
>    // Names in multiple places in the diamond.
>    top_left(&c);
> @@ -20,10 +25,3 @@ void test_diamond(int i, float f, double
>    lr.left = 17;
>  }
>
> -// RUN: rm -rf %t
> -// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_top %S/Inputs/module.map
> -// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_left %S/Inputs/module.map
> -// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_right %S/Inputs/module.map
> -// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_bottom %S/Inputs/module.map
> -// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t %s -verify
> -// FIXME: When we have a syntax for modules in C, use that.
>
> Modified: cfe/trunk/test/Modules/linkage-merge.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/linkage-merge.cpp?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/linkage-merge.cpp (original)
> +++ cfe/trunk/test/Modules/linkage-merge.cpp Wed Apr 17 03:06:46 2013
> @@ -1,13 +1,12 @@
> -// FIXME: we should be able to put these in the .h file :-(
> -// expected-note {{target of using declaration}}
> -// expected-note {{using declaration}}
> +// RUN: rm -rf %t
> +// RUN: %clang_cc1 -verify -fmodules -fmodules-cache-path=%t -I %S/Inputs %s
>
>  #include "linkage-merge-bar.h"
>
>  static int f(int);
>  int f(int);
>
> -static void g(int); // expected-error {{declaration conflicts with target of using declaration already in scope}}
> -
> -// RUN: rm -rf %t
> -// RUN: %clang_cc1 -verify -fmodules -fmodules-cache-path=%t -I %S/Inputs %s
> +static void g(int);
> +// expected-error at -1 {{declaration conflicts with target of using declaration already in scope}}
> +// expected-note at Inputs/linkage-merge-foo.h:2 {{target of using declaration}}
> +// expected-note at Inputs/linkage-merge-bar.h:3 {{using declaration}}
>
> Modified: cfe/trunk/test/Modules/linkage-merge.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/linkage-merge.m?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/linkage-merge.m (original)
> +++ cfe/trunk/test/Modules/linkage-merge.m Wed Apr 17 03:06:46 2013
> @@ -1,27 +1,26 @@
> -// In module: expected-note{{previous declaration}}
> -
> -
> -
> -
> -// In module: expected-note{{previous definition is here}}
> +// RUN: rm -rf %t
> +// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=linkage_merge_left %S/Inputs/module.map
> +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -w %s -verify
>
>  // Test redeclarations of functions where the original declaration is
>  // still hidden.
>
>  @import linkage_merge_left; // excludes "sub"
>
> -extern int f0(float); // expected-error{{conflicting types for 'f0'}}
> +extern int f0(float);
> +// expected-error at -1{{conflicting types for 'f0'}}
> +// expected-note at Inputs/linkage-merge-sub.h:1{{previous declaration}}
> +
>  static int f1(float); // okay: considered distinct
>  static int f2(float); // okay: considered distinct
>  extern int f3(float); // okay: considered distinct
>
> -extern float v0; // expected-error{{redefinition of 'v0' with a different type: 'float' vs 'int'}}
> +extern float v0;
> +// expected-error at -1{{redefinition of 'v0' with a different type: 'float' vs 'int'}}
> +// expected-note at Inputs/linkage-merge-sub.h:6{{previous definition is here}}
> +
>  static float v1;
>  static float v2;
>  extern float v3;
>
>  typedef float T0;
> -
> -// RUN: rm -rf %t
> -// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=linkage_merge_left %S/Inputs/module.map
> -// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -w %s -verify
>
> Modified: cfe/trunk/test/Modules/lookup.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/lookup.cpp?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/lookup.cpp (original)
> +++ cfe/trunk/test/Modules/lookup.cpp Wed Apr 17 03:06:46 2013
> @@ -5,7 +5,7 @@ import lookup_left_cxx;
>  #define IMPORT(X) @import X
>  IMPORT(lookup_right_cxx);
>
> -// in lookup_left.hpp: expected-warning at 3 {{weak identifier 'weak_identifier' never declared}}
> +// expected-warning at Inputs/lookup_left.hpp:3 {{weak identifier 'weak_identifier' never declared}}
>
>  void test(int i, float f) {
>    // unqualified lookup
>
> Modified: cfe/trunk/test/Modules/lookup.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/lookup.m?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/lookup.m (original)
> +++ cfe/trunk/test/Modules/lookup.m Wed Apr 17 03:06:46 2013
> @@ -1,19 +1,19 @@
> +// RUN: rm -rf %t
> +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -emit-module -x objective-c -fmodule-name=lookup_left_objc %S/Inputs/module.map
> +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -emit-module -x objective-c -fmodule-name=lookup_right_objc %S/Inputs/module.map
> +// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -verify %s
> +// RUN: %clang_cc1 -fmodules -ast-print -x objective-c -fmodules-cache-path=%t %s | FileCheck -check-prefix=CHECK-PRINT %s
>
> -// lookup_left.h: expected-note{{using}}
> -// lookup_right.h: expected-note{{also found}}
>  @import lookup_left_objc;
>  @import lookup_right_objc;
>
>  void test(id x) {
> -  [x method]; // expected-warning{{multiple methods named 'method' found}}
> +  [x method];
> +// expected-warning at -1{{multiple methods named 'method' found}}
> +// expected-note at Inputs/lookup_left.h:2{{using}}
> +// expected-note at Inputs/lookup_right.h:3{{also found}}
>  }
>
> -// RUN: rm -rf %t
> -// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -emit-module -x objective-c -fmodule-name=lookup_left_objc %S/Inputs/module.map
> -// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -emit-module -x objective-c -fmodule-name=lookup_right_objc %S/Inputs/module.map
> -// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -verify %s
> -// RUN: %clang_cc1 -fmodules -ast-print -x objective-c -fmodules-cache-path=%t %s | FileCheck -check-prefix=CHECK-PRINT %s
> -
>  // CHECK-PRINT: - (int) method;
>  // CHECK-PRINT: - (double) method
>  // CHECK-PRINT: void test(id x)
>
> Modified: cfe/trunk/test/Modules/macros.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/macros.c?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/macros.c (original)
> +++ cfe/trunk/test/Modules/macros.c Wed Apr 17 03:06:46 2013
> @@ -8,13 +8,13 @@
>  // FIXME: When we have a syntax for modules in C, use that.
>  // These notes come from headers in modules, and are bogus.
>
> -// FIXME: expected-note{{previous definition is here}}
> -// FIXME: expected-note{{previous definition is here}} expected-note{{expanding this definition of 'LEFT_RIGHT_DIFFERENT'}}
> -// expected-note{{other definition of 'TOP_RIGHT_REDEF'}} expected-note{{expanding this definition of 'LEFT_RIGHT_DIFFERENT2'}}
> -// expected-note{{other definition of 'LEFT_RIGHT_DIFFERENT'}}
> -
> -
> -// expected-note{{expanding this definition of 'TOP_RIGHT_REDEF'}}
> +// FIXME: expected-note at Inputs/macros_left.h:11{{previous definition is here}}
> +// FIXME: expected-note at Inputs/macros_right.h:12{{previous definition is here}}
> +// expected-note at Inputs/macros_right.h:12{{expanding this definition of 'LEFT_RIGHT_DIFFERENT'}}
> +// expected-note at Inputs/macros_top.h:13{{other definition of 'TOP_RIGHT_REDEF'}}
> +// expected-note at Inputs/macros_right.h:13{{expanding this definition of 'LEFT_RIGHT_DIFFERENT2'}}
> +// expected-note at Inputs/macros_left.h:14{{other definition of 'LEFT_RIGHT_DIFFERENT'}}
> +// expected-note at Inputs/macros_right.h:17{{expanding this definition of 'TOP_RIGHT_REDEF'}}
>
>  @import macros;
>
>
> Modified: cfe/trunk/test/Modules/method_pool.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/method_pool.m?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/method_pool.m (original)
> +++ cfe/trunk/test/Modules/method_pool.m Wed Apr 17 03:06:46 2013
> @@ -8,8 +8,8 @@
>  - (void)method5:(D*)obj;
>  @end
>
> -// in other file: // expected-note at 7{{using}}
> -// in other file: expected-note at 12{{also found}}
> +// expected-note at Inputs/MethodPoolA.h:7{{using}}
> +// expected-note at Inputs/MethodPoolB.h:12{{also found}}
>
>  void testMethod1(id object) {
>    [object method1];
> @@ -51,8 +51,8 @@ void testMethod3Again(id object) {
>
>  void testMethod3AgainAgain(id object) {
>    [object method3]; // expected-warning{{multiple methods named 'method3' found}}
> -  // expected-note at 2{{using}}
> -  // expected-note at 2{{also found}}
> +  // expected-note at Inputs/MethodPoolBSub.h:2{{using}}
> +  // expected-note at Inputs/MethodPoolASub.h:2{{also found}}
>  }
>
>  void testMethod4Again(id object) {
>
> Modified: cfe/trunk/test/Modules/module-private.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/module-private.cpp?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/module-private.cpp (original)
> +++ cfe/trunk/test/Modules/module-private.cpp Wed Apr 17 03:06:46 2013
> @@ -15,7 +15,7 @@ int test_broken() {
>    HiddenStruct hidden; // \
>    // expected-error{{must use 'struct' tag to refer to type 'HiddenStruct' in this scope}} \
>    // expected-error{{definition of 'struct HiddenStruct' must be imported}}
> -  // expected-note at 3 {{previous definition is here}}
> +  // expected-note at Inputs/module_private_left.h:3 {{previous definition is here}}
>
>    Integer i; // expected-error{{unknown type name 'Integer'}}
>
>
> Modified: cfe/trunk/test/Modules/namespaces.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/namespaces.cpp?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/namespaces.cpp (original)
> +++ cfe/trunk/test/Modules/namespaces.cpp Wed Apr 17 03:06:46 2013
> @@ -73,5 +73,5 @@ void testAnonymousNotMerged() {
>    N12::consumeFoo(N12::getFoo()); // expected-error{{cannot initialize a parameter of type 'N12::<anonymous>::Foo *' with an rvalue of type 'N12::<anonymous>::Foo *'}}
>  }
>
> -// namespaces-right.h: expected-note at 60 {{passing argument to parameter here}}
> -// namespaces-right.h: expected-note at 67 {{passing argument to parameter here}}
> +// expected-note at Inputs/namespaces-right.h:60 {{passing argument to parameter here}}
> +// expected-note at Inputs/namespaces-right.h:67 {{passing argument to parameter here}}
>
> Modified: cfe/trunk/test/Modules/normal-module-map.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/normal-module-map.cpp?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/normal-module-map.cpp (original)
> +++ cfe/trunk/test/Modules/normal-module-map.cpp Wed Apr 17 03:06:46 2013
> @@ -1,5 +1,3 @@
> -// Note: inside the module. expected-note{{'nested_umbrella_a' declared here}}
> -
>  // RUN: rm -rf %t
>  // RUN: %clang_cc1 -x objective-c -fmodules-cache-path=%t -fmodules -I %S/Inputs/normal-module-map %s -verify
>  #include "Umbrella/umbrella_sub.h"
> @@ -25,7 +23,9 @@ int testNestedUmbrellaA() {
>  }
>
>  int testNestedUmbrellaBFail() {
> -  return nested_umbrella_b; // expected-error{{use of undeclared identifier 'nested_umbrella_b'; did you mean 'nested_umbrella_a'?}}
> +  return nested_umbrella_b;
> +  // expected-error at -1{{use of undeclared identifier 'nested_umbrella_b'; did you mean 'nested_umbrella_a'?}}
> +  // expected-note at Inputs/normal-module-map/nested_umbrella/a.h:1{{'nested_umbrella_a' declared here}}
>  }
>
>  @import nested_umbrella.b;
>
> Modified: cfe/trunk/test/Modules/objc-categories.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/objc-categories.m?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/objc-categories.m (original)
> +++ cfe/trunk/test/Modules/objc-categories.m Wed Apr 17 03:06:46 2013
> @@ -8,11 +8,8 @@
>
>  @import category_bottom;
>
> -
> -
> -
> -// in category_left.h: expected-note {{previous definition}}
> -// in category_right.h: expected-warning at 11 {{duplicate definition of category}}
> +// expected-note at Inputs/category_left.h:14 {{previous definition}}
> +// expected-warning at Inputs/category_right.h:11 {{duplicate definition of category}}
>
>  @interface Foo(Source)
>  -(void)source;
> @@ -75,7 +72,7 @@ void test_hidden_right_errors(Foo *foo)
>    [p4 p4_method]; // expected-warning{{instance method '-p4_method' not found (return type defaults to 'id')}}
>    id p4p = p4.p4_prop; // expected-error{{property 'p4_prop' not found on object of type 'id<P4>'}}
>    p4p = foo.p4_prop; // expected-error{{property 'p4_prop' not found on object of type 'Foo *'; did you mean 'p3_prop'?}}
> -  // expected-note at 7{{'p3_prop' declared here}}
> +  // expected-note at Inputs/category_left_sub.h:7{{'p3_prop' declared here}}
>  }
>
>  @import category_right.sub;
>
> Modified: cfe/trunk/test/Modules/on-demand-build.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/on-demand-build.m?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/on-demand-build.m (original)
> +++ cfe/trunk/test/Modules/on-demand-build.m Wed Apr 17 03:06:46 2013
> @@ -7,7 +7,7 @@
>  @interface OtherClass
>  @end
>
> -// in module: expected-note at 17{{class method 'alloc' is assumed to return an instance of its receiver type ('Module *')}}
> +// expected-note at Inputs/Module.framework/Headers/Module.h:17{{class method 'alloc' is assumed to return an instance of its receiver type ('Module *')}}
>  void test_getModuleVersion() {
>    const char *version = getModuleVersion();
>    const char *version2 = [Module version];
>
> Modified: cfe/trunk/test/Modules/redecl-merge.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/redecl-merge.m?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/redecl-merge.m (original)
> +++ cfe/trunk/test/Modules/redecl-merge.m Wed Apr 17 03:06:46 2013
> @@ -27,8 +27,8 @@ int *call_eventually_noreturn_again(void
>  int *call_eventually_noreturn2_again(void) {
>    // noreturn and non-noreturn functions have different types
>    eventually_noreturn2(); // expected-error{{call to 'eventually_noreturn2' is ambiguous}}
> -  // expected-note at 93{{candidate function}}
> -  // expected-note at 90{{candidate function}}
> +  // expected-note at Inputs/redecl-merge-left.h:93{{candidate function}}
> +  // expected-note at Inputs/redecl-merge-right.h:90{{candidate function}}
>  }
>
>  @implementation A
> @@ -79,24 +79,26 @@ void testTypedefMerge(int i, double d) {
>    T1 *ip = &i;
>    // FIXME: Typedefs aren't actually merged in the sense of other merges, because
>    // we should only merge them when the types are identical.
> -  // in other file: expected-note at 60{{candidate found by name lookup is 'T2'}}
> -  // in other file: expected-note at 63{{candidate found by name lookup is 'T2'}}
> +  // expected-note at Inputs/redecl-merge-left.h:60{{candidate found by name lookup is 'T2'}}
> +  // expected-note at Inputs/redecl-merge-right.h:63{{candidate found by name lookup is 'T2'}}
>    T2 *dp = &d; // expected-error{{reference to 'T2' is ambiguous}}
>  }
>
>  void testFuncMerge(int i) {
>    func0(i);
>    func1(i);
> -  // in other file: expected-note at 64{{candidate function}}
> -  // in other file: expected-note at 70{{candidate function}}
> +  // expected-note at Inputs/redecl-merge-left.h:64{{candidate function}}
> +  // expected-note at Inputs/redecl-merge-right.h:70{{candidate function}}
>    func2(i); // expected-error{{call to 'func2' is ambiguous}}
>  }
>
>  void testVarMerge(int i) {
>    var1 = i;
> -  // in other files: expected-note at 77 2{{candidate found by name lookup is 'var2'}}
> +  // expected-note at Inputs/redecl-merge-left.h:77{{candidate found by name lookup is 'var2'}}
> +  // expected-note at Inputs/redecl-merge-right.h:77{{candidate found by name lookup is 'var2'}}
>    var2 = i; // expected-error{{reference to 'var2' is ambiguous}}
> -  // in other files: expected-note at 79 2{{candidate found by name lookup is 'var3'}}
> +  // expected-note at Inputs/redecl-merge-left.h:79{{candidate found by name lookup is 'var3'}}
> +  // expected-note at Inputs/redecl-merge-right.h:79{{candidate found by name lookup is 'var3'}}
>    var3 = i; // expected-error{{reference to 'var3' is ambiguous}}
>  }
>
>
> Modified: cfe/trunk/test/Modules/subframeworks.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/subframeworks.m?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Modules/subframeworks.m (original)
> +++ cfe/trunk/test/Modules/subframeworks.m Wed Apr 17 03:06:46 2013
> @@ -23,7 +23,7 @@ CXXOnly cxxonly;
>
>  @import HasSubModules;
>
> -// expected-warning at 1{{treating #include as an import of module 'HasSubModules.Sub.Types'}}
> +// expected-warning at Inputs/HasSubModules.framework/Frameworks/Sub.framework/PrivateHeaders/SubPriv.h:1{{treating #include as an import of module 'HasSubModules.Sub.Types'}}
>  #import <HasSubModules/HasSubModulesPriv.h>
>
>  struct FrameworkSubStruct ss;
>
> Modified: cfe/trunk/test/PCH/cxx-using.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/cxx-using.cpp?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/PCH/cxx-using.cpp (original)
> +++ cfe/trunk/test/PCH/cxx-using.cpp Wed Apr 17 03:06:46 2013
> @@ -6,10 +6,9 @@
>  // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
>
>  void m() {
> -    D s;   // expected-note {{candidate function}}
> +    D s;
>      s.f(); // expected-error {{no matching member}}
>  }
>
> -
> -
> -// expected-note {{candidate function}}
> +// expected-note at cxx-using.h:9  {{candidate function}}
> +// expected-note at cxx-using.h:15 {{candidate function}}
>
> Modified: cfe/trunk/test/PCH/cxx11-statement-attributes.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/cxx11-statement-attributes.cpp?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/PCH/cxx11-statement-attributes.cpp (original)
> +++ cfe/trunk/test/PCH/cxx11-statement-attributes.cpp Wed Apr 17 03:06:46 2013
> @@ -4,8 +4,7 @@
>  // RUN: %clang_cc1 -x c++-header -emit-pch -std=c++11 -o %t %S/Inputs/cxx11-statement-attributes.h
>  // RUN: %clang_cc1 -include-pch %t -std=c++11 -Wimplicit-fallthrough -fsyntax-only %s -o - -verify
>
> -// Warning from Inputs/cxx11-statement-attributes.h:
> -// expected-warning at 10 {{fallthrough annotation does not directly precede switch label}}
> +// expected-warning at Inputs/cxx11-statement-attributes.h:10 {{fallthrough annotation does not directly precede switch label}}
>
>  void g(int n) {
>    f<1>(n);  // expected-note {{in instantiation of function template specialization 'f<1>' requested here}}
>
> Modified: cfe/trunk/test/PCH/functions.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/functions.c?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/PCH/functions.c (original)
> +++ cfe/trunk/test/PCH/functions.c Wed Apr 17 03:06:46 2013
> @@ -4,18 +4,20 @@
>  // Test with pch.
>  // RUN: %clang_cc1 -emit-pch -o %t %S/functions.h
>  // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
> -// expected-note{{'f1' declared here}}
> +
>  int f0(int x0, int y0, ...) { return x0 + y0; }
> -// expected-note{{passing argument to parameter here}}
> +
>  float *test_f1(int val, double x, double y) {
>    if (val > 5)
>      return f1(x, y);
>    else
>      return f1(x); // expected-error{{too few arguments to function call}}
> +                  // expected-note at functions.h:7{{'f1' declared here}}
>  }
>
>  void test_g0(int *x, float * y) {
>    g0(y); // expected-warning{{incompatible pointer types passing 'float *' to parameter of type 'int *'}}
> +         // expected-note at functions.h:9{{passing argument to parameter here}}
>    g0(x);
>  }
>
>
> Modified: cfe/trunk/test/PCH/method_pool.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/method_pool.m?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/PCH/method_pool.m (original)
> +++ cfe/trunk/test/PCH/method_pool.m Wed Apr 17 03:06:46 2013
> @@ -9,13 +9,5 @@ int message_id(id x) {
>     return [x instMethod:17]; // expected-warning{{multiple methods}}
>  }
>
> -
> -
> -
> -
> -/* Whitespace below is significant */
> -/* expected-note{{using}} */
> -
> -
> -
> -/* expected-note{{also}} */
> +/* expected-note at method_pool.h:17{{using}} */
> +/* expected-note at method_pool.h:21{{also}} */
>
> Modified: cfe/trunk/test/PCH/nonvisible-external-defs.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/nonvisible-external-defs.c?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/PCH/nonvisible-external-defs.c (original)
> +++ cfe/trunk/test/PCH/nonvisible-external-defs.c Wed Apr 17 03:06:46 2013
> @@ -7,4 +7,4 @@
>
>  int g(int, float); // expected-error{{conflicting types}}
>
> -// expected-note{{previous declaration}}
> +// expected-note at nonvisible-external-defs.h:10{{previous declaration}}
>
> Modified: cfe/trunk/test/PCH/reloc.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/reloc.c?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/PCH/reloc.c (original)
> +++ cfe/trunk/test/PCH/reloc.c Wed Apr 17 03:06:46 2013
> @@ -10,5 +10,5 @@ int x = 2; // expected-error{{redefiniti
>  int y = 5; // expected-error{{redefinition}}
>
>
> -// expected-note{{previous definition}}
> -// expected-note{{previous definition}}
> +// expected-note at libroot/usr/include/reloc.h:13{{previous definition}}
> +// expected-note at libroot/usr/include/reloc2.h:14{{previous definition}}
>
> Modified: cfe/trunk/test/PCH/tentative-defs.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/tentative-defs.c?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/PCH/tentative-defs.c (original)
> +++ cfe/trunk/test/PCH/tentative-defs.c Wed Apr 17 03:06:46 2013
> @@ -5,5 +5,4 @@
>  // RUN: grep "@variable = common global i32 0" %t | count 1
>  // RUN: grep "@incomplete_array = common global .*1 x i32" %t | count 1
>
> -
> -// FIXME: tentative-defs.h expected-warning{{tentative}}
> +// FIXME: expected-warning at tentative-defs.h:9{{tentative}}
>
> Modified: cfe/trunk/test/PCH/typo.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/typo.cpp?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/PCH/typo.cpp (original)
> +++ cfe/trunk/test/PCH/typo.cpp Wed Apr 17 03:06:46 2013
> @@ -1,17 +1,14 @@
> -
> -// In header: expected-note{{'boost::function' declared here}}
> -
> -
> -// In header: expected-note{{'boost::graph::adjacency_list' declared here}}
> -
> -
> -
> -adjacent_list<int, int> g; // expected-error{{no template named 'adjacent_list'; did you mean 'boost::graph::adjacency_list'?}}
> -Function<int(int)> f; // expected-error{{no template named 'Function'; did you mean 'boost::function'?}}
> -
>  // Without PCH
>  // RUN: %clang_cc1 -include %S/Inputs/typo.hpp -verify %s
>
>  // With PCH
>  // RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/Inputs/typo.hpp
>  // RUN: %clang_cc1 -include-pch %t -verify %s
> +
> +adjacent_list<int, int> g;
> +// expected-error at -1{{no template named 'adjacent_list'; did you mean 'boost::graph::adjacency_list'?}}
> +// expected-note at Inputs/typo.hpp:5{{'boost::graph::adjacency_list' declared here}}
> +
> +Function<int(int)> f;
> +// expected-error at -1{{no template named 'Function'; did you mean 'boost::function'?}}
> +// expected-note at Inputs/typo.hpp:2{{'boost::function' declared here}}
>
> Modified: cfe/trunk/test/PCH/typo.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/typo.m?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/PCH/typo.m (original)
> +++ cfe/trunk/test/PCH/typo.m Wed Apr 17 03:06:46 2013
> @@ -1,6 +1,7 @@
>  // RUN: %clang_cc1 -x objective-c-header -emit-pch -o %t %S/Inputs/typo.h
>  // RUN: %clang_cc1 -include-pch %t -verify %s
> -// In header: expected-note{{declared here}}
> +
>  void f() {
>    [NSstring alloc]; // expected-error{{unknown receiver 'NSstring'; did you mean 'NSString'?}}
> +                    // expected-note at Inputs/typo.h:3{{declared here}}
>  }
>
> Modified: cfe/trunk/test/Sema/pragma-arc-cf-code-audited.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/pragma-arc-cf-code-audited.c?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/Sema/pragma-arc-cf-code-audited.c (original)
> +++ cfe/trunk/test/Sema/pragma-arc-cf-code-audited.c Wed Apr 17 03:06:46 2013
> @@ -13,6 +13,6 @@
>  #include "Inputs/pragma-arc-cf-code-audited.h" // expected-error {{cannot #include files inside '#pragma clang arc_cf_code_audited'}}
>
>  // This is actually on the #pragma line in the header.
> -// expected-error {{'#pragma clang arc_cf_code_audited' was not ended within this file}}
> +// expected-error at Inputs/pragma-arc-cf-code-audited.h:16 {{'#pragma clang arc_cf_code_audited' was not ended within this file}}
>
>  #pragma clang arc_cf_code_audited begin // expected-error {{'#pragma clang arc_cf_code_audited' was not ended within this file}}
>
> Modified: cfe/trunk/test/SemaObjC/arc-system-header.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc-system-header.m?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/SemaObjC/arc-system-header.m (original)
> +++ cfe/trunk/test/SemaObjC/arc-system-header.m Wed Apr 17 03:06:46 2013
> @@ -1,30 +1,30 @@
> -// silly workaround expected-note {{marked unavailable here}}
>  // RUN: %clang_cc1 -fobjc-arc -isystem %S/Inputs %s -DNO_USE
>  // RUN: %clang_cc1 -fobjc-arc -isystem %S/Inputs %s -verify
>
> -// another silly workaround expected-note {{marked unavailable here}}
>  #include <arc-system-header.h>
>
>  #ifndef NO_USE
>  void test(id op, void *cp) {
>    cp = test0(op); // expected-error {{'test0' is unavailable: converts between Objective-C and C pointers in -fobjc-arc}}
>    cp = *test1(&op); // expected-error {{'test1' is unavailable: converts between Objective-C and C pointers in -fobjc-arc}}
> +// expected-note at arc-system-header.h:1 {{marked unavailable here}}
> +// expected-note at arc-system-header.h:5 {{marked unavailable here}}
>  }
>
> -// workaround expected-note {{marked unavailable here}}
>  void test3(struct Test3 *p) {
>    p->field = 0; // expected-error {{'field' is unavailable: this system declaration uses an unsupported type}}
> +                // expected-note at arc-system-header.h:14 {{marked unavailable here}}
>  }
>
> -// workaround expected-note {{marked unavailable here}}
>  void test4(Test4 *p) {
>    p->field1 = 0; // expected-error {{'field1' is unavailable: this system declaration uses an unsupported type}}
> +                 // expected-note at arc-system-header.h:19 {{marked unavailable here}}
>    p->field2 = 0;
>  }
>
> -// workaround expected-note {{marked unavailable here}}
>  void test5(struct Test5 *p) {
>    p->field = 0; // expected-error {{'field' is unavailable: this system field has retaining ownership}}
> +                // expected-note at arc-system-header.h:25 {{marked unavailable here}}
>  }
>
>  id test6() {
> @@ -38,12 +38,13 @@ id test6() {
>    x = (id) (test6_helper(), kMagicConstant);
>  }
>
> -// workaround expected-note 4 {{marked unavailable here}} expected-note 2 {{property 'prop' is declared unavailable here}}
>  void test7(Test7 *p) {
>    *p.prop = 0; // expected-error {{'prop' is unavailable: this system declaration uses an unsupported type}}
>    p.prop = 0; // expected-error {{'prop' is unavailable: this system declaration uses an unsupported type}}
>    *[p prop] = 0; // expected-error {{'prop' is unavailable: this system declaration uses an unsupported type}}
>    [p setProp: 0]; // expected-error {{'setProp:' is unavailable: this system declaration uses an unsupported type}}
> +// expected-note at arc-system-header.h:41 4 {{marked unavailable here}}
> +// expected-note at arc-system-header.h:41 2 {{property 'prop' is declared unavailable here}}
>  }
>  #endif
>
>
> Modified: cfe/trunk/test/SemaObjCXX/arc-system-header.mm
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/arc-system-header.mm?rev=179677&r1=179676&r2=179677&view=diff
> ==============================================================================
> --- cfe/trunk/test/SemaObjCXX/arc-system-header.mm (original)
> +++ cfe/trunk/test/SemaObjCXX/arc-system-header.mm Wed Apr 17 03:06:46 2013
> @@ -6,5 +6,4 @@ void f(A* a) {
>    a->data.void_ptr = 0;
>    a->data.a_b.b = 0; // expected-error{{'a_b' is unavailable: this system field has retaining ownership}}
>  }
> -// Silly location below
> -// expected-note{{declaration has been explicitly marked unavailable here}}
> +// expected-note at arc-system-header.h:10{{declaration has been explicitly marked unavailable here}}
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list