Index: include/clang/Driver/CC1Options.td =================================================================== --- include/clang/Driver/CC1Options.td +++ include/clang/Driver/CC1Options.td @@ -63,6 +63,9 @@ def analyzer_output_EQ : Joined<["-"], "analyzer-output=">, Alias; +def analyzer_output_no_fragile : Flag<["-"], "analyzer-output-no-fragile">, + HelpText<"Do not output version and path information">; + def analyzer_purge : Separate<["-"], "analyzer-purge">, HelpText<"Source Code Analysis - Dead Symbol Removal Frequency">; def analyzer_purge_EQ : Joined<["-"], "analyzer-purge=">, Alias; Index: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h =================================================================== --- include/clang/StaticAnalyzer/Core/AnalyzerOptions.h +++ include/clang/StaticAnalyzer/Core/AnalyzerOptions.h @@ -154,6 +154,11 @@ /// command-line options will get checked. unsigned DisableAllChecks : 1; + /// Do not output Clang version and source paths. + /// + /// This option is primarily for using in the testsuite. + unsigned DisableFragileOutput : 1; + unsigned ShowCheckerHelp : 1; unsigned ShowEnabledCheckerList : 1; unsigned AnalyzeAll : 1; Index: lib/Frontend/CompilerInvocation.cpp =================================================================== --- lib/Frontend/CompilerInvocation.cpp +++ lib/Frontend/CompilerInvocation.cpp @@ -281,6 +281,7 @@ Opts.ShowCheckerHelp = Args.hasArg(OPT_analyzer_checker_help); Opts.ShowEnabledCheckerList = Args.hasArg(OPT_analyzer_list_enabled_checkers); Opts.DisableAllChecks = Args.hasArg(OPT_analyzer_disable_all_checks); + Opts.DisableFragileOutput = Args.hasArg(OPT_analyzer_output_no_fragile); Opts.visualizeExplodedGraphWithGraphViz = Args.hasArg(OPT_analyzer_viz_egraph_graphviz); Index: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp =================================================================== --- lib/StaticAnalyzer/Core/PlistDiagnostics.cpp +++ lib/StaticAnalyzer/Core/PlistDiagnostics.cpp @@ -34,6 +34,7 @@ const LangOptions &LangOpts; const bool SupportsCrossFileDiagnostics; const bool SerializeStatistics; + const bool DisableFragileOutput; public: PlistDiagnostics(AnalyzerOptions &AnalyzerOpts, const std::string& prefix, @@ -66,7 +67,8 @@ : OutputFile(output), LangOpts(LO), SupportsCrossFileDiagnostics(supportsMultipleFiles), - SerializeStatistics(AnalyzerOpts.shouldSerializeStats()) {} + SerializeStatistics(AnalyzerOpts.shouldSerializeStats()), + DisableFragileOutput(AnalyzerOpts.DisableFragileOutput) {} void ento::createPlistDiagnosticConsumer(AnalyzerOptions &AnalyzerOpts, PathDiagnosticConsumers &C, @@ -425,9 +427,11 @@ // - "clang_version", the string representation of clang version // - "files", an mapping from FIDs to file names // - "diagnostics", an containing the path diagnostics - o << "\n" << - " clang_version\n"; - EmitString(o, getClangFullVersion()) << '\n'; + o << "\n"; + if (!DisableFragileOutput) { + o << " clang_version\n"; + EmitString(o, getClangFullVersion()) << '\n'; + } o << " diagnostics\n" " \n"; @@ -587,11 +591,13 @@ o << " \n"; - o << " files\n" - " \n"; - for (FileID FID : Fids) - EmitString(o << " ", SM->getFileEntryForID(FID)->getName()) << '\n'; - o << " \n"; + if (!DisableFragileOutput) { + o << " files\n" + " \n"; + for (FileID FID : Fids) + EmitString(o << " ", SM->getFileEntryForID(FID)->getName()) << '\n'; + o << " \n"; + } if (llvm::AreStatisticsEnabled() && SerializeStatistics) { o << " statistics\n"; Index: test/Analysis/Inputs/expected-plists/NewDelete-path-notes.cpp.plist =================================================================== --- test/Analysis/Inputs/expected-plists/NewDelete-path-notes.cpp.plist +++ test/Analysis/Inputs/expected-plists/NewDelete-path-notes.cpp.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -456,9 +454,5 @@ - files - - /clang/test/Analysis/NewDelete-path-notes.cpp - Index: test/Analysis/Inputs/expected-plists/conditional-path-notes.c.plist =================================================================== --- test/Analysis/Inputs/expected-plists/conditional-path-notes.c.plist +++ test/Analysis/Inputs/expected-plists/conditional-path-notes.c.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -1764,9 +1762,5 @@ - files - - /clang/test/Analysis/conditional-path-notes.c - Index: test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist =================================================================== --- test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist +++ test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -1671,9 +1669,5 @@ - files - - /clang/test/Analysis/cxx-for-range.cpp - Index: test/Analysis/Inputs/expected-plists/edges-new.mm.plist =================================================================== --- test/Analysis/Inputs/expected-plists/edges-new.mm.plist +++ test/Analysis/Inputs/expected-plists/edges-new.mm.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -21444,9 +21442,5 @@ - files - - /clang/test/Analysis/edges-new.mm - Index: test/Analysis/Inputs/expected-plists/generics.m.plist =================================================================== --- test/Analysis/Inputs/expected-plists/generics.m.plist +++ test/Analysis/Inputs/expected-plists/generics.m.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -7188,9 +7186,5 @@ - files - - /clang/test/Analysis/generics.m - Index: test/Analysis/Inputs/expected-plists/inline-plist.c.plist =================================================================== --- test/Analysis/Inputs/expected-plists/inline-plist.c.plist +++ test/Analysis/Inputs/expected-plists/inline-plist.c.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -1978,9 +1976,5 @@ - files - - /clang/test/Analysis/inline-plist.c - Index: test/Analysis/Inputs/expected-plists/inline-unique-reports.c.plist =================================================================== --- test/Analysis/Inputs/expected-plists/inline-unique-reports.c.plist +++ test/Analysis/Inputs/expected-plists/inline-unique-reports.c.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -270,9 +268,5 @@ - files - - /clang/test/Analysis/inline-unique-reports.c - Index: test/Analysis/Inputs/expected-plists/method-call-path-notes.cpp.plist =================================================================== --- test/Analysis/Inputs/expected-plists/method-call-path-notes.cpp.plist +++ test/Analysis/Inputs/expected-plists/method-call-path-notes.cpp.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -837,9 +835,5 @@ - files - - /clang/test/Analysis/method-call-path-notes.cpp - Index: test/Analysis/Inputs/expected-plists/model-file.cpp.plist =================================================================== --- test/Analysis/Inputs/expected-plists/model-file.cpp.plist +++ test/Analysis/Inputs/expected-plists/model-file.cpp.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -300,10 +298,5 @@ - files - - /clang/test/Analysis/model-file.cpp - /clang/test/Analysis/Inputs/Models/notzero.model - Index: test/Analysis/Inputs/expected-plists/null-deref-path-notes.m.plist =================================================================== --- test/Analysis/Inputs/expected-plists/null-deref-path-notes.m.plist +++ test/Analysis/Inputs/expected-plists/null-deref-path-notes.m.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -1020,9 +1018,5 @@ - files - - /clang/test/Analysis/null-deref-path-notes.m - Index: test/Analysis/Inputs/expected-plists/nullability-notes.m.plist =================================================================== --- test/Analysis/Inputs/expected-plists/nullability-notes.m.plist +++ test/Analysis/Inputs/expected-plists/nullability-notes.m.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -197,9 +195,5 @@ - files - - /clang/test/Analysis/nullability-notes.m - Index: test/Analysis/Inputs/expected-plists/objc-arc.m.plist =================================================================== --- test/Analysis/Inputs/expected-plists/objc-arc.m.plist +++ test/Analysis/Inputs/expected-plists/objc-arc.m.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -2081,9 +2079,5 @@ - files - - /clang/test/Analysis/objc-arc.m - Index: test/Analysis/Inputs/expected-plists/plist-macros.cpp.plist =================================================================== --- test/Analysis/Inputs/expected-plists/plist-macros.cpp.plist +++ test/Analysis/Inputs/expected-plists/plist-macros.cpp.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -1753,9 +1751,5 @@ - files - - /clang/test/Analysis/plist-macros.cpp - Index: test/Analysis/Inputs/expected-plists/plist-output-alternate.m.plist =================================================================== --- test/Analysis/Inputs/expected-plists/plist-output-alternate.m.plist +++ test/Analysis/Inputs/expected-plists/plist-output-alternate.m.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -1512,9 +1510,5 @@ - files - - /clang/test/Analysis/plist-output-alternate.m - Index: test/Analysis/Inputs/expected-plists/plist-output.m.plist =================================================================== --- test/Analysis/Inputs/expected-plists/plist-output.m.plist +++ test/Analysis/Inputs/expected-plists/plist-output.m.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -6212,9 +6210,5 @@ - files - - /clang/test/Analysis/plist-output.m - Index: test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist =================================================================== --- test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist +++ test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -5260,9 +5258,5 @@ - files - - /clang/test/Analysis/retain-release-path-notes.m - Index: test/Analysis/Inputs/expected-plists/unix-fns.c.plist =================================================================== --- test/Analysis/Inputs/expected-plists/unix-fns.c.plist +++ test/Analysis/Inputs/expected-plists/unix-fns.c.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -3013,9 +3011,5 @@ - files - - /clang/test/Analysis/unix-fns.c - Index: test/Analysis/NewDelete-path-notes.cpp =================================================================== --- test/Analysis/NewDelete-path-notes.cpp +++ test/Analysis/NewDelete-path-notes.cpp @@ -1,7 +1,7 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=text -verify %s // RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=text -analyzer-config c++-allocator-inlining=true -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=plist %s -o %t.plist -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/NewDelete-path-notes.cpp.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=plist -analyzer-output-no-fragile %s -o %t.plist +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/NewDelete-path-notes.cpp.plist void test() { int *p = new int; Index: test/Analysis/conditional-path-notes.c =================================================================== --- test/Analysis/conditional-path-notes.c +++ test/Analysis/conditional-path-notes.c @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference -analyzer-output=text -verify -// RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference -analyzer-output=plist -o %t -// RUN: cat %t | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/conditional-path-notes.c.plist +// RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference -analyzer-output=plist -analyzer-output-no-fragile -o %t +// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/conditional-path-notes.c.plist void testCondOp(int *p) { int *x = p ? p : p; Index: test/Analysis/copypaste/Inputs/expected-plists/plist-diagnostics-notes-as-events.cpp.plist =================================================================== --- test/Analysis/copypaste/Inputs/expected-plists/plist-diagnostics-notes-as-events.cpp.plist +++ test/Analysis/copypaste/Inputs/expected-plists/plist-diagnostics-notes-as-events.cpp.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -90,9 +88,5 @@ - files - - /clang/test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp - Index: test/Analysis/copypaste/Inputs/expected-plists/plist-diagnostics.cpp.plist =================================================================== --- test/Analysis/copypaste/Inputs/expected-plists/plist-diagnostics.cpp.plist +++ test/Analysis/copypaste/Inputs/expected-plists/plist-diagnostics.cpp.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -91,9 +89,5 @@ - files - - /clang/test/Analysis/copypaste/plist-diagnostics.cpp - Index: test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp =================================================================== --- test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp +++ test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-output=plist -analyzer-config notes-as-events=true -o %t.plist -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/plist-diagnostics-notes-as-events.cpp.plist +// RUN: %clang_analyze_cc1 -analyzer-output=plist -analyzer-output-no-fragile -analyzer-config notes-as-events=true -o %t.plist -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/plist-diagnostics-notes-as-events.cpp.plist void log(); Index: test/Analysis/copypaste/plist-diagnostics.cpp =================================================================== --- test/Analysis/copypaste/plist-diagnostics.cpp +++ test/Analysis/copypaste/plist-diagnostics.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-output=plist -o %t.plist -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/plist-diagnostics.cpp.plist +// RUN: %clang_analyze_cc1 -analyzer-output=plist -analyzer-output-no-fragile -o %t.plist -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/plist-diagnostics.cpp.plist void log(); Index: test/Analysis/cxx-for-range.cpp =================================================================== --- test/Analysis/cxx-for-range.cpp +++ test/Analysis/cxx-for-range.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core -analyzer-output=plist-multi-file -o %t.plist -verify -analyzer-config eagerly-assume=false %s -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/cxx-for-range.cpp.plist +// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile -o %t.plist -verify -analyzer-config eagerly-assume=false %s +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/cxx-for-range.cpp.plist extern void work(); Index: test/Analysis/diagnostics/Inputs/expected-plists/deref-track-symbolic-region.c.plist =================================================================== --- test/Analysis/diagnostics/Inputs/expected-plists/deref-track-symbolic-region.c.plist +++ test/Analysis/diagnostics/Inputs/expected-plists/deref-track-symbolic-region.c.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -649,9 +647,5 @@ - files - - /clang/test/Analysis/diagnostics/deref-track-symbolic-region.c - Index: test/Analysis/diagnostics/Inputs/expected-plists/report-issues-within-main-file.cpp.plist =================================================================== --- test/Analysis/diagnostics/Inputs/expected-plists/report-issues-within-main-file.cpp.plist +++ test/Analysis/diagnostics/Inputs/expected-plists/report-issues-within-main-file.cpp.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -1826,10 +1824,5 @@ - files - - /clang/test/Analysis/diagnostics/report-issues-within-main-file.cpp - /clang/test/Analysis/diagnostics/Inputs/include/report-issues-within-main-file.h - Index: test/Analysis/diagnostics/Inputs/expected-plists/undef-value-caller.c.plist =================================================================== --- test/Analysis/diagnostics/Inputs/expected-plists/undef-value-caller.c.plist +++ test/Analysis/diagnostics/Inputs/expected-plists/undef-value-caller.c.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -133,10 +131,5 @@ - files - - /clang/test/Analysis/diagnostics/undef-value-caller.c - /clang/test/Analysis/diagnostics/undef-value-callee.h - Index: test/Analysis/diagnostics/Inputs/expected-plists/undef-value-param.c.plist =================================================================== --- test/Analysis/diagnostics/Inputs/expected-plists/undef-value-param.c.plist +++ test/Analysis/diagnostics/Inputs/expected-plists/undef-value-param.c.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -1336,9 +1334,5 @@ - files - - /clang/test/Analysis/diagnostics/undef-value-param.c - Index: test/Analysis/diagnostics/Inputs/expected-plists/undef-value-param.m.plist =================================================================== --- test/Analysis/diagnostics/Inputs/expected-plists/undef-value-param.m.plist +++ test/Analysis/diagnostics/Inputs/expected-plists/undef-value-param.m.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -1019,9 +1017,5 @@ - files - - /clang/test/Analysis/diagnostics/undef-value-param.m - Index: test/Analysis/diagnostics/deref-track-symbolic-region.c =================================================================== --- test/Analysis/diagnostics/deref-track-symbolic-region.c +++ test/Analysis/diagnostics/deref-track-symbolic-region.c @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file %s -o %t.plist -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/deref-track-symbolic-region.c.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile %s -o %t.plist +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/deref-track-symbolic-region.c.plist struct S { int *x; Index: test/Analysis/diagnostics/report-issues-within-main-file.cpp =================================================================== --- test/Analysis/diagnostics/report-issues-within-main-file.cpp +++ test/Analysis/diagnostics/report-issues-within-main-file.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -analyzer-output=plist-multi-file -analyzer-config report-in-main-source-file=true %s -o %t.plist -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/report-issues-within-main-file.cpp.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -analyzer-output=plist-multi-file -analyzer-output-no-fragile -analyzer-config report-in-main-source-file=true %s -o %t.plist +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/report-issues-within-main-file.cpp.plist #include "Inputs/include/report-issues-within-main-file.h" void mainPlusHeader() { Index: test/Analysis/diagnostics/undef-value-caller.c =================================================================== --- test/Analysis/diagnostics/undef-value-caller.c +++ test/Analysis/diagnostics/undef-value-caller.c @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist -o %t %s -// RUN: cat %t | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/undef-value-caller.c.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist -analyzer-output-no-fragile -o %t %s +// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/undef-value-caller.c.plist #include "undef-value-callee.h" Index: test/Analysis/diagnostics/undef-value-param.c =================================================================== --- test/Analysis/diagnostics/undef-value-param.c +++ test/Analysis/diagnostics/undef-value-param.c @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file %s -o %t.plist -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/undef-value-param.c.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile %s -o %t.plist +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/undef-value-param.c.plist void foo_irrelevant(int c) { if (c) Index: test/Analysis/diagnostics/undef-value-param.m =================================================================== --- test/Analysis/diagnostics/undef-value-param.m +++ test/Analysis/diagnostics/undef-value-param.m @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core,osx -analyzer-output=text -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx -analyzer-output=plist-multi-file %s -o %t.plist -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/undef-value-param.m.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx -analyzer-output=plist-multi-file -analyzer-output-no-fragile %s -o %t.plist +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/undef-value-param.m.plist typedef signed char BOOL; @protocol NSObject - (BOOL)isEqual:(id)object; @end Index: test/Analysis/edges-new.mm =================================================================== --- test/Analysis/edges-new.mm +++ test/Analysis/edges-new.mm @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,deadcode.DeadStores,osx.cocoa.RetainCount,unix.Malloc,unix.MismatchedDeallocator -analyzer-output=plist -o %t -w %s -// RUN: cat %t | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/edges-new.mm.plist +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,deadcode.DeadStores,osx.cocoa.RetainCount,unix.Malloc,unix.MismatchedDeallocator -analyzer-output=plist -analyzer-output-no-fragile -o %t -w %s +// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/edges-new.mm.plist //===----------------------------------------------------------------------===// // Forward declarations (from headers). Index: test/Analysis/generics.m =================================================================== --- test/Analysis/generics.m +++ test/Analysis/generics.m @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.ObjCGenerics,alpha.core.DynamicTypeChecker -verify -Wno-objc-method-access %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.ObjCGenerics,alpha.core.DynamicTypeChecker -verify -Wno-objc-method-access %s -analyzer-output=plist -o %t.plist -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/generics.m.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.ObjCGenerics,alpha.core.DynamicTypeChecker -verify -Wno-objc-method-access %s -analyzer-output=plist -analyzer-output-no-fragile -o %t.plist +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/generics.m.plist #if !__has_feature(objc_generics) # error Compiler does not support Objective-C generics? Index: test/Analysis/inline-plist.c =================================================================== --- test/Analysis/inline-plist.c +++ test/Analysis/inline-plist.c @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference,core.DivideZero -fblocks -analyzer-output=text -analyzer-config suppress-null-return-paths=false -verify -analyzer-config eagerly-assume=false %s -// RUN: %clang_analyze_cc1 -analyzer-config eagerly-assume=false %s -analyzer-checker=core.NullDereference,core.DivideZero -fblocks -analyzer-output=plist -analyzer-config suppress-null-return-paths=false -o %t -// RUN: cat %t | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/inline-plist.c.plist +// RUN: %clang_analyze_cc1 -analyzer-config eagerly-assume=false %s -analyzer-checker=core.NullDereference,core.DivideZero -fblocks -analyzer-output=plist -analyzer-output-no-fragile -analyzer-config suppress-null-return-paths=false -o %t +// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/inline-plist.c.plist // void mmm(int y) { Index: test/Analysis/inline-unique-reports.c =================================================================== --- test/Analysis/inline-unique-reports.c +++ test/Analysis/inline-unique-reports.c @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference -analyzer-output=plist -o %t > /dev/null 2>&1 -// RUN: cat %t | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/inline-unique-reports.c.plist +// RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference -analyzer-output=plist -analyzer-output-no-fragile -o %t > /dev/null 2>&1 +// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/inline-unique-reports.c.plist static inline bug(int *p) { *p = 0xDEADBEEF; Index: test/Analysis/inlining/Inputs/expected-plists/eager-reclamation-path-notes.c.plist =================================================================== --- test/Analysis/inlining/Inputs/expected-plists/eager-reclamation-path-notes.c.plist +++ test/Analysis/inlining/Inputs/expected-plists/eager-reclamation-path-notes.c.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -645,9 +643,5 @@ - files - - /clang/test/Analysis/inlining/eager-reclamation-path-notes.c - Index: test/Analysis/inlining/Inputs/expected-plists/eager-reclamation-path-notes.cpp.plist =================================================================== --- test/Analysis/inlining/Inputs/expected-plists/eager-reclamation-path-notes.cpp.plist +++ test/Analysis/inlining/Inputs/expected-plists/eager-reclamation-path-notes.cpp.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -369,9 +367,5 @@ - files - - /clang/test/Analysis/inlining/eager-reclamation-path-notes.cpp - Index: test/Analysis/inlining/Inputs/expected-plists/path-notes.c.plist =================================================================== --- test/Analysis/inlining/Inputs/expected-plists/path-notes.c.plist +++ test/Analysis/inlining/Inputs/expected-plists/path-notes.c.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -3772,9 +3770,5 @@ - files - - /clang/test/Analysis/inlining/path-notes.c - Index: test/Analysis/inlining/Inputs/expected-plists/path-notes.cpp.plist =================================================================== --- test/Analysis/inlining/Inputs/expected-plists/path-notes.cpp.plist +++ test/Analysis/inlining/Inputs/expected-plists/path-notes.cpp.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -5219,9 +5217,5 @@ - files - - /clang/test/Analysis/inlining/path-notes.cpp - Index: test/Analysis/inlining/Inputs/expected-plists/path-notes.m.plist =================================================================== --- test/Analysis/inlining/Inputs/expected-plists/path-notes.m.plist +++ test/Analysis/inlining/Inputs/expected-plists/path-notes.m.plist @@ -2,8 +2,6 @@ - clang_version -clang version 8.0.0 diagnostics @@ -1993,9 +1991,5 @@ - files - - /clang/test/Analysis/inlining/path-notes.m - Index: test/Analysis/inlining/eager-reclamation-path-notes.c =================================================================== --- test/Analysis/inlining/eager-reclamation-path-notes.c +++ test/Analysis/inlining/eager-reclamation-path-notes.c @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -analyzer-config graph-trim-interval=5 -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config graph-trim-interval=5 %s -o %t.plist -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/eager-reclamation-path-notes.c.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile -analyzer-config graph-trim-interval=5 %s -o %t.plist +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/eager-reclamation-path-notes.c.plist void use(int *ptr, int val) { *ptr = val; // expected-warning {{Dereference of null pointer (loaded from variable 'ptr')}} Index: test/Analysis/inlining/eager-reclamation-path-notes.cpp =================================================================== --- test/Analysis/inlining/eager-reclamation-path-notes.cpp +++ test/Analysis/inlining/eager-reclamation-path-notes.cpp @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -analyzer-config graph-trim-interval=5 -analyzer-config suppress-null-return-paths=false -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config graph-trim-interval=5 -analyzer-config suppress-null-return-paths=false %s -o %t.plist -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/eager-reclamation-path-notes.cpp.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile -analyzer-config graph-trim-interval=5 -analyzer-config suppress-null-return-paths=false %s -o %t.plist +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/eager-reclamation-path-notes.cpp.plist typedef struct { int getValue(); Index: test/Analysis/inlining/path-notes.c =================================================================== --- test/Analysis/inlining/path-notes.c +++ test/Analysis/inlining/path-notes.c @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -analyzer-config suppress-null-return-paths=false -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config suppress-null-return-paths=false %s -o %t.plist -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/path-notes.c.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile -analyzer-config suppress-null-return-paths=false %s -o %t.plist +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/path-notes.c.plist void zero(int **p) { *p = 0; Index: test/Analysis/inlining/path-notes.cpp =================================================================== --- test/Analysis/inlining/path-notes.cpp +++ test/Analysis/inlining/path-notes.cpp @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -analyzer-config c++-inlining=destructors -std=c++11 -verify -Wno-tautological-undefined-compare %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config c++-inlining=destructors -std=c++11 %s -o %t.plist -Wno-tautological-undefined-compare -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/path-notes.cpp.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile -analyzer-config c++-inlining=destructors -std=c++11 %s -o %t.plist -Wno-tautological-undefined-compare +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/path-notes.cpp.plist class Foo { public: Index: test/Analysis/inlining/path-notes.m =================================================================== --- test/Analysis/inlining/path-notes.m +++ test/Analysis/inlining/path-notes.m @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount -analyzer-output=text -analyzer-config suppress-null-return-paths=false -fblocks -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount -analyzer-output=plist-multi-file -analyzer-config suppress-null-return-paths=false -fblocks %s -o %t.plist -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/path-notes.m.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount -analyzer-output=plist-multi-file -analyzer-output-no-fragile -analyzer-config suppress-null-return-paths=false -fblocks %s -o %t.plist +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/path-notes.m.plist typedef struct dispatch_queue_s *dispatch_queue_t; typedef void (^dispatch_block_t)(void); Index: test/Analysis/method-call-path-notes.cpp =================================================================== --- test/Analysis/method-call-path-notes.cpp +++ test/Analysis/method-call-path-notes.cpp @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file %s -o %t.plist -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/method-call-path-notes.cpp.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile %s -o %t.plist +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/method-call-path-notes.cpp.plist // Test warning about null or uninitialized pointer values used as instance member // calls. Index: test/Analysis/model-file.cpp =================================================================== --- test/Analysis/model-file.cpp +++ test/Analysis/model-file.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-config faux-bodies=true,model-path=%S/Inputs/Models -analyzer-output=plist-multi-file -verify %s -o %t -// RUN: cat %t | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/model-file.cpp.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-config faux-bodies=true,model-path=%S/Inputs/Models -analyzer-output=plist-multi-file -analyzer-output-no-fragile -verify %s -o %t +// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/model-file.cpp.plist typedef int* intptr; Index: test/Analysis/null-deref-path-notes.m =================================================================== --- test/Analysis/null-deref-path-notes.m +++ test/Analysis/null-deref-path-notes.m @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region -analyzer-output=text -fblocks -verify -Wno-objc-root-class %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region -analyzer-output=plist-multi-file -fblocks -Wno-objc-root-class %s -o %t -// RUN: cat %t | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/null-deref-path-notes.m.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region -analyzer-output=plist-multi-file -analyzer-output-no-fragile -fblocks -Wno-objc-root-class %s -o %t +// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/null-deref-path-notes.m.plist @interface Root { @public Index: test/Analysis/nullability-notes.m =================================================================== --- test/Analysis/nullability-notes.m +++ test/Analysis/nullability-notes.m @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,nullability.NullableDereferenced -analyzer-output=text -verify %s -// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,nullability.NullableDereferenced -analyzer-output=plist -o %t.plist %s -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/nullability-notes.m.plist +// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,nullability.NullableDereferenced -analyzer-output=plist -analyzer-output-no-fragile -o %t.plist %s +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/nullability-notes.m.plist #include "Inputs/system-header-simulator-for-nullability.h" Index: test/Analysis/objc-arc.m =================================================================== --- test/Analysis/objc-arc.m +++ test/Analysis/objc-arc.m @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.cocoa.RetainCount,deadcode -verify -fblocks -analyzer-opt-analyze-nested-blocks -fobjc-arc -analyzer-output=plist-multi-file -o %t.plist %s -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/objc-arc.m.plist +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.cocoa.RetainCount,deadcode -verify -fblocks -analyzer-opt-analyze-nested-blocks -fobjc-arc -analyzer-output=plist-multi-file -analyzer-output-no-fragile -o %t.plist %s +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/objc-arc.m.plist typedef signed char BOOL; typedef struct _NSZone NSZone; Index: test/Analysis/plist-macros.cpp =================================================================== --- test/Analysis/plist-macros.cpp +++ test/Analysis/plist-macros.cpp @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -analyzer-output=plist-multi-file %s -o %t.plist -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/plist-macros.cpp.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -analyzer-output=plist-multi-file -analyzer-output-no-fragile %s -o %t.plist +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/plist-macros.cpp.plist typedef __typeof(sizeof(int)) size_t; Index: test/Analysis/plist-output-alternate.m =================================================================== --- test/Analysis/plist-output-alternate.m +++ test/Analysis/plist-output-alternate.m @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -fblocks -analyzer-output=plist -o %t %s -// RUN: cat %t | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/plist-output-alternate.m.plist +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -fblocks -analyzer-output=plist -analyzer-output-no-fragile -o %t %s +// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/plist-output-alternate.m.plist void test_null_init(void) { int *p = 0; Index: test/Analysis/plist-output.m =================================================================== --- test/Analysis/plist-output.m +++ test/Analysis/plist-output.m @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-config eagerly-assume=false %s -analyzer-checker=osx.cocoa.RetainCount,deadcode.DeadStores,core -analyzer-output=plist -o %t.plist -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/plist-output.m.plist +// RUN: %clang_analyze_cc1 -analyzer-config eagerly-assume=false %s -analyzer-checker=osx.cocoa.RetainCount,deadcode.DeadStores,core -analyzer-output=plist -analyzer-output-no-fragile -o %t.plist +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/plist-output.m.plist void test_null_init(void) { int *p = 0; Index: test/Analysis/retain-release-path-notes.m =================================================================== --- test/Analysis/retain-release-path-notes.m +++ test/Analysis/retain-release-path-notes.m @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=text -verify %s -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=plist-multi-file %s -o %t -// RUN: cat %t | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/retain-release-path-notes.m.plist +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=plist-multi-file -analyzer-output-no-fragile %s -o %t +// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/retain-release-path-notes.m.plist /*** This file is for testing the path-sensitive notes for retain/release errors. Index: test/Analysis/unix-fns.c =================================================================== --- test/Analysis/unix-fns.c +++ test/Analysis/unix-fns.c @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,unix.API,osx.API,optin.portability %s -analyzer-store=region -analyzer-output=plist -analyzer-config faux-bodies=true -fblocks -verify -o %t.plist -// RUN: cat %t.plist | diff -u -w -I "/" -I ".:" -I "version" - %S/Inputs/expected-plists/unix-fns.c.plist +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,unix.API,osx.API,optin.portability %s -analyzer-store=region -analyzer-output=plist -analyzer-output-no-fragile -analyzer-config faux-bodies=true -fblocks -verify -o %t.plist +// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/unix-fns.c.plist // RUN: mkdir -p %t.dir // RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.API,osx.API,optin.portability -analyzer-output=html -analyzer-config faux-bodies=true -fblocks -o %t.dir %s // RUN: rm -fR %t.dir