From: Hubert Tong Date: Tue, 11 Jun 2019 14:21:32 +0000 (+0000) Subject: Reapply r362994 & co "[analyzer][tests] Add normalize_plist to replace diff_plist" X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=702e6d07bfdf9480cfda153c17a41b4134068659;p=clang Reapply r362994 & co "[analyzer][tests] Add normalize_plist to replace diff_plist" Following r363007, which reverted r362998, r362996, and r362994, reapply with adjustments for the CRLF differences encountered with Windows. Namely, the `-b` option of `diff` is employed, and the `grep` patterns have `$` replaced with `[[:space:]]*$`. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363069 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/MismatchedDeallocator-path-notes.cpp b/test/Analysis/MismatchedDeallocator-path-notes.cpp index 5529d495be..814ad3a21b 100644 --- a/test/Analysis/MismatchedDeallocator-path-notes.cpp +++ b/test/Analysis/MismatchedDeallocator-path-notes.cpp @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.MismatchedDeallocator -analyzer-output=text -verify %s // RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.MismatchedDeallocator -analyzer-output=plist %s -o %t.plist -// RUN: tail -n +11 %t.plist | %diff_plist %S/copypaste/Inputs/expected-plists/MismatchedDeallocator-path-notes.cpp.plist - +// RUN: tail -n +11 %t.plist | %normalize_plist | diff -ub %S/copypaste/Inputs/expected-plists/MismatchedDeallocator-path-notes.cpp.plist - void changePointee(int *p); int *allocIntArray(unsigned c) { diff --git a/test/Analysis/NewDelete-path-notes.cpp b/test/Analysis/NewDelete-path-notes.cpp index d556947507..e4093fd152 100644 --- a/test/Analysis/NewDelete-path-notes.cpp +++ b/test/Analysis/NewDelete-path-notes.cpp @@ -11,7 +11,7 @@ // RUN: -analyzer-checker=cplusplus.NewDelete,unix.Malloc \ // RUN: -analyzer-config add-pop-up-notes=false \ // RUN: -analyzer-output=plist %s -o %t.plist -// RUN: cat %t.plist | %diff_plist \ +// RUN: %normalize_plist <%t.plist | diff -ub \ // RUN: %S/Inputs/expected-plists/NewDelete-path-notes.cpp.plist - void test() { diff --git a/test/Analysis/conditional-path-notes.c b/test/Analysis/conditional-path-notes.c index fb2dd9f2ca..5ef81d81a0 100644 --- a/test/Analysis/conditional-path-notes.c +++ b/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_plist %S/Inputs/expected-plists/conditional-path-notes.c.plist - +// RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/conditional-path-notes.c.plist - void testCondOp(int *p) { int *x = p ? p : p; diff --git a/test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp b/test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp index 301a30b1c1..d202859d9a 100644 --- a/test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp +++ b/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_plist %S/Inputs/expected-plists/plist-diagnostics-notes-as-events.cpp.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/plist-diagnostics-notes-as-events.cpp.plist - void log(); diff --git a/test/Analysis/copypaste/plist-diagnostics.cpp b/test/Analysis/copypaste/plist-diagnostics.cpp index c5ea2ae20e..c499aba4f0 100644 --- a/test/Analysis/copypaste/plist-diagnostics.cpp +++ b/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_plist %S/Inputs/expected-plists/plist-diagnostics.cpp.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/plist-diagnostics.cpp.plist - void log(); diff --git a/test/Analysis/cxx-for-range.cpp b/test/Analysis/cxx-for-range.cpp index 4e5fb0ea7f..034007813e 100644 --- a/test/Analysis/cxx-for-range.cpp +++ b/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_plist %S/Inputs/expected-plists/cxx-for-range.cpp.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/cxx-for-range.cpp.plist - extern void work(); diff --git a/test/Analysis/diagnostics/deref-track-symbolic-region.c b/test/Analysis/diagnostics/deref-track-symbolic-region.c index 1a1190f934..597ad4fabb 100644 --- a/test/Analysis/diagnostics/deref-track-symbolic-region.c +++ b/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_plist %S/Inputs/expected-plists/deref-track-symbolic-region.c.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/deref-track-symbolic-region.c.plist - struct S { int *x; diff --git a/test/Analysis/diagnostics/plist-diagnostics-include-check.cpp b/test/Analysis/diagnostics/plist-diagnostics-include-check.cpp index 26beda5300..9e6c890eec 100644 --- a/test/Analysis/diagnostics/plist-diagnostics-include-check.cpp +++ b/test/Analysis/diagnostics/plist-diagnostics-include-check.cpp @@ -1,5 +1,5 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=debug.ExprInspection -analyzer-output=plist-multi-file %s -o %t.plist -// RUN: tail -n +11 %t.plist | %diff_plist %S/Inputs/expected-plists/plist-diagnostics-include-check.cpp.plist - +// RUN: tail -n +11 %t.plist | %normalize_plist | diff -ub %S/Inputs/expected-plists/plist-diagnostics-include-check.cpp.plist - #include "Inputs/include/plist-diagnostics-include-check-macro.h" diff --git a/test/Analysis/diagnostics/plist-multi-file.c b/test/Analysis/diagnostics/plist-multi-file.c index f6ff8097ff..fc1d581562 100644 --- a/test/Analysis/diagnostics/plist-multi-file.c +++ b/test/Analysis/diagnostics/plist-multi-file.c @@ -1,5 +1,5 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -o %t.plist -verify %s -// RUN: tail -n +11 %t.plist | %diff_plist %S/Inputs/expected-plists/plist-multi-file.c.plist - +// RUN: tail -n +11 %t.plist | %normalize_plist | diff -ub %S/Inputs/expected-plists/plist-multi-file.c.plist - #include "plist-multi-file.h" diff --git a/test/Analysis/diagnostics/report-issues-within-main-file.cpp b/test/Analysis/diagnostics/report-issues-within-main-file.cpp index f166e311c5..5937affc42 100644 --- a/test/Analysis/diagnostics/report-issues-within-main-file.cpp +++ b/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_plist %S/Inputs/expected-plists/report-issues-within-main-file.cpp.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/report-issues-within-main-file.cpp.plist - #include "Inputs/include/report-issues-within-main-file.h" void mainPlusHeader() { diff --git a/test/Analysis/diagnostics/undef-value-caller.c b/test/Analysis/diagnostics/undef-value-caller.c index d537f726f8..aded5d3701 100644 --- a/test/Analysis/diagnostics/undef-value-caller.c +++ b/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_plist %S/Inputs/expected-plists/undef-value-caller.c.plist - +// RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/undef-value-caller.c.plist - #include "undef-value-callee.h" diff --git a/test/Analysis/diagnostics/undef-value-param.c b/test/Analysis/diagnostics/undef-value-param.c index de128dafc4..1c755157e1 100644 --- a/test/Analysis/diagnostics/undef-value-param.c +++ b/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_plist %S/Inputs/expected-plists/undef-value-param.c.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/undef-value-param.c.plist - void foo_irrelevant(int c) { if (c) diff --git a/test/Analysis/diagnostics/undef-value-param.m b/test/Analysis/diagnostics/undef-value-param.m index 5dfd9f8216..c0c37a74bd 100644 --- a/test/Analysis/diagnostics/undef-value-param.m +++ b/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_plist %S/Inputs/expected-plists/undef-value-param.m.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/undef-value-param.m.plist - typedef signed char BOOL; @protocol NSObject - (BOOL)isEqual:(id)object; @end diff --git a/test/Analysis/edges-new.mm b/test/Analysis/edges-new.mm index 5a58850d06..dda1bfb31e 100644 --- a/test/Analysis/edges-new.mm +++ b/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_plist %S/Inputs/expected-plists/edges-new.mm.plist - +// RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/edges-new.mm.plist - //===----------------------------------------------------------------------===// // Forward declarations (from headers). diff --git a/test/Analysis/generics.m b/test/Analysis/generics.m index 1d6fa84a9c..7616a5d57d 100644 --- a/test/Analysis/generics.m +++ b/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_plist %S/Inputs/expected-plists/generics.m.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/generics.m.plist - #if !__has_feature(objc_generics) # error Compiler does not support Objective-C generics? diff --git a/test/Analysis/inline-plist.c b/test/Analysis/inline-plist.c index dbcca5c2f7..b6221073e4 100644 --- a/test/Analysis/inline-plist.c +++ b/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_plist %S/Inputs/expected-plists/inline-plist.c.plist - +// RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/inline-plist.c.plist - // void mmm(int y) { diff --git a/test/Analysis/inline-unique-reports.c b/test/Analysis/inline-unique-reports.c index 94289a1e8d..a20975a9af 100644 --- a/test/Analysis/inline-unique-reports.c +++ b/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_plist %S/Inputs/expected-plists/inline-unique-reports.c.plist - +// RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/inline-unique-reports.c.plist - static inline bug(int *p) { *p = 0xDEADBEEF; diff --git a/test/Analysis/inlining/eager-reclamation-path-notes.c b/test/Analysis/inlining/eager-reclamation-path-notes.c index 8dfd14dd34..d4ac66da36 100644 --- a/test/Analysis/inlining/eager-reclamation-path-notes.c +++ b/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_plist %S/Inputs/expected-plists/eager-reclamation-path-notes.c.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %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')}} diff --git a/test/Analysis/inlining/eager-reclamation-path-notes.cpp b/test/Analysis/inlining/eager-reclamation-path-notes.cpp index 7cbda91b65..57c4a21fe8 100644 --- a/test/Analysis/inlining/eager-reclamation-path-notes.cpp +++ b/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_plist %S/Inputs/expected-plists/eager-reclamation-path-notes.cpp.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/eager-reclamation-path-notes.cpp.plist - typedef struct { int getValue(); diff --git a/test/Analysis/inlining/path-notes.c b/test/Analysis/inlining/path-notes.c index 253ff949dc..25b5e5b557 100644 --- a/test/Analysis/inlining/path-notes.c +++ b/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_plist %S/Inputs/expected-plists/path-notes.c.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/path-notes.c.plist - void zero(int **p) { *p = 0; diff --git a/test/Analysis/inlining/path-notes.cpp b/test/Analysis/inlining/path-notes.cpp index ef56cc76f8..59726df37b 100644 --- a/test/Analysis/inlining/path-notes.cpp +++ b/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_plist %S/Inputs/expected-plists/path-notes.cpp.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/path-notes.cpp.plist - class Foo { public: diff --git a/test/Analysis/inlining/path-notes.m b/test/Analysis/inlining/path-notes.m index d48a891976..33e4357da2 100644 --- a/test/Analysis/inlining/path-notes.m +++ b/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_plist %S/Inputs/expected-plists/path-notes.m.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/path-notes.m.plist - typedef struct dispatch_queue_s *dispatch_queue_t; typedef void (^dispatch_block_t)(void); diff --git a/test/Analysis/lambda-notes.cpp b/test/Analysis/lambda-notes.cpp index e436068501..2cb3abbba7 100644 --- a/test/Analysis/lambda-notes.cpp +++ b/test/Analysis/lambda-notes.cpp @@ -1,5 +1,5 @@ // RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core.DivideZero -analyzer-config inline-lambdas=true -analyzer-output plist -verify %s -o %t -// RUN: tail -n +11 %t | %diff_plist %S/Inputs/expected-plists/lambda-notes.cpp.plist - +// RUN: tail -n +11 %t | %normalize_plist | diff -ub %S/Inputs/expected-plists/lambda-notes.cpp.plist - // Diagnostic inside a lambda diff --git a/test/Analysis/lit.local.cfg b/test/Analysis/lit.local.cfg index 84f7569152..bfe4589438 100644 --- a/test/Analysis/lit.local.cfg +++ b/test/Analysis/lit.local.cfg @@ -9,10 +9,13 @@ import analyzer_test config.test_format = analyzer_test.AnalyzerTest( config.test_format.execute_external, config.use_z3_solver) -# Diff command used by Clang Analyzer tests (when comparing .plist files +# Filtering command used by Clang Analyzer tests (when comparing .plist files # with reference output) -config.substitutions.append(('%diff_plist', - 'diff -u -w -I "/" -I ".:" -I "version"')) +config.substitutions.append(('%normalize_plist', + "grep -Ev '%s|%s|%s'" % + ('^[[:space:]]*.* version .*[[:space:]]*$', + '^[[:space:]]*/.*[[:space:]]*$', + '^[[:space:]]*.:.*[[:space:]]*$'))) # Diff command for testing SARIF output to reference output. config.substitutions.append(('%diff_sarif', diff --git a/test/Analysis/malloc-plist.c b/test/Analysis/malloc-plist.c index 86a921db08..1beecc9076 100644 --- a/test/Analysis/malloc-plist.c +++ b/test/Analysis/malloc-plist.c @@ -1,6 +1,6 @@ // RUN: rm -f %t // RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,unix.Malloc -analyzer-output=plist -verify -o %t -analyzer-config eagerly-assume=false %s -// RUN: tail -n +11 %t | %diff_plist %S/Inputs/expected-plists/malloc-plist.c.plist - +// RUN: tail -n +11 %t | %normalize_plist | diff -ub %S/Inputs/expected-plists/malloc-plist.c.plist - typedef __typeof(sizeof(int)) size_t; void *malloc(size_t); diff --git a/test/Analysis/method-call-path-notes.cpp b/test/Analysis/method-call-path-notes.cpp index 0da25117b0..c3d1a99fc9 100644 --- a/test/Analysis/method-call-path-notes.cpp +++ b/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_plist %S/Inputs/expected-plists/method-call-path-notes.cpp.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/method-call-path-notes.cpp.plist - // Test warning about null or uninitialized pointer values used as instance member // calls. diff --git a/test/Analysis/model-file.cpp b/test/Analysis/model-file.cpp index c5615e9271..3a8322075b 100644 --- a/test/Analysis/model-file.cpp +++ b/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_plist %S/Inputs/expected-plists/model-file.cpp.plist - +// RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/model-file.cpp.plist - typedef int* intptr; diff --git a/test/Analysis/null-deref-path-notes.m b/test/Analysis/null-deref-path-notes.m index 46ca4b3e78..837664aa39 100644 --- a/test/Analysis/null-deref-path-notes.m +++ b/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_plist %S/Inputs/expected-plists/null-deref-path-notes.m.plist - +// RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/null-deref-path-notes.m.plist - @interface Root { @public diff --git a/test/Analysis/nullability-notes.m b/test/Analysis/nullability-notes.m index 850d18327e..39dbb8fd72 100644 --- a/test/Analysis/nullability-notes.m +++ b/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_plist %S/Inputs/expected-plists/nullability-notes.m.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/nullability-notes.m.plist - #include "Inputs/system-header-simulator-for-nullability.h" diff --git a/test/Analysis/objc-arc.m b/test/Analysis/objc-arc.m index 30e4ffcadd..cab6618a43 100644 --- a/test/Analysis/objc-arc.m +++ b/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_plist %S/Inputs/expected-plists/objc-arc.m.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/objc-arc.m.plist - typedef signed char BOOL; typedef struct _NSZone NSZone; diff --git a/test/Analysis/objc-radar17039661.m b/test/Analysis/objc-radar17039661.m index 484e43c5dd..c53b3e0fbf 100644 --- a/test/Analysis/objc-radar17039661.m +++ b/test/Analysis/objc-radar17039661.m @@ -1,6 +1,6 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount -fblocks -verify %s // RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount -fblocks -analyzer-output=plist-multi-file %s -o %t -// RUN: cat %t | %diff_plist %S/Inputs/expected-plists/objc-radar17039661.m.plist - +// RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/objc-radar17039661.m.plist - @class NSString; typedef long NSInteger; diff --git a/test/Analysis/plist-macros-with-expansion.cpp b/test/Analysis/plist-macros-with-expansion.cpp index c062a4782c..e836c78b4b 100644 --- a/test/Analysis/plist-macros-with-expansion.cpp +++ b/test/Analysis/plist-macros-with-expansion.cpp @@ -5,7 +5,7 @@ // RUN: -analyzer-config expand-macros=true // // Check the actual plist output. -// RUN: cat %t.plist | %diff_plist \ +// RUN: %normalize_plist <%t.plist | diff -ub \ // RUN: %S/Inputs/expected-plists/plist-macros-with-expansion.cpp.plist - // // Check the macro expansions from the plist output here, to make the test more diff --git a/test/Analysis/plist-macros.cpp b/test/Analysis/plist-macros.cpp index 3eb604e2ed..94f8e514c8 100644 --- a/test/Analysis/plist-macros.cpp +++ b/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_plist %S/Inputs/expected-plists/plist-macros.cpp.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/plist-macros.cpp.plist - typedef __typeof(sizeof(int)) size_t; diff --git a/test/Analysis/plist-output-alternate.m b/test/Analysis/plist-output-alternate.m index 525f738dc7..f9d5bccefe 100644 --- a/test/Analysis/plist-output-alternate.m +++ b/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_plist %S/Inputs/expected-plists/plist-output-alternate.m.plist - +// RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/plist-output-alternate.m.plist - void test_null_init(void) { int *p = 0; diff --git a/test/Analysis/plist-output.m b/test/Analysis/plist-output.m index 21602fc472..32916333cb 100644 --- a/test/Analysis/plist-output.m +++ b/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_plist %S/Inputs/expected-plists/plist-output.m.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/plist-output.m.plist - void test_null_init(void) { int *p = 0; diff --git a/test/Analysis/retain-release-path-notes.m b/test/Analysis/retain-release-path-notes.m index 23171eda1c..b6072bae67 100644 --- a/test/Analysis/retain-release-path-notes.m +++ b/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_plist %S/Inputs/expected-plists/retain-release-path-notes.m.plist - +// RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/retain-release-path-notes.m.plist - /*** This file is for testing the path-sensitive notes for retain/release errors. diff --git a/test/Analysis/retain-release.m b/test/Analysis/retain-release.m index a5f24af749..ad79d72d1a 100644 --- a/test/Analysis/retain-release.m +++ b/test/Analysis/retain-release.m @@ -17,8 +17,8 @@ // RUN: -Wno-objc-root-class -x objective-c++ -std=gnu++98\ // RUN: -analyzer-config osx.cocoa.RetainCount:TrackNSCFStartParam=true\ // RUN: -DTRACK_START_PARAM -// RUN: cat %t.objcpp.plist | %diff_plist %S/Inputs/expected-plists/retain-release.m.objcpp.plist - -// RUN: cat %t.objc.plist | %diff_plist %S/Inputs/expected-plists/retain-release.m.objc.plist - +// RUN: %normalize_plist <%t.objcpp.plist | diff -ub %S/Inputs/expected-plists/retain-release.m.objcpp.plist - +// RUN: %normalize_plist <%t.objc.plist | diff -ub %S/Inputs/expected-plists/retain-release.m.objc.plist - void clang_analyzer_eval(int); diff --git a/test/Analysis/unix-fns.c b/test/Analysis/unix-fns.c index 96e5d1d445..c526f1b3e4 100644 --- a/test/Analysis/unix-fns.c +++ b/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_plist %S/Inputs/expected-plists/unix-fns.c.plist - +// RUN: %normalize_plist <%t.plist | diff -ub %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