summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorHubert Tong <hubert.reinterpretcast@gmail.com>2019-06-10 22:40:35 +0000
committerHubert Tong <hubert.reinterpretcast@gmail.com>2019-06-10 22:40:35 +0000
commitdbc85509bae636fa09957c5746f5592a0d52297a (patch)
tree9fd9b30c3b3d33b8955acdda74fc8440f8fda08a /clang
parentcc129f310eead28911dbd27367cb83dd63752181 (diff)
downloadbcm5719-llvm-dbc85509bae636fa09957c5746f5592a0d52297a.tar.gz
bcm5719-llvm-dbc85509bae636fa09957c5746f5592a0d52297a.zip
[analyzer][tests] Use normalize_plist in place of diff_plist (`tail` cases)
Summary: The `%diff_plist` lit substitution invokes `diff` with a non-portable `-I` option. The intended effect can be achieved by normalizing the inputs to `diff` beforehand. Such normalization can be done with `grep -Ev`, which is also used by other tests. This patch applies the change (adjusted for review comments) described in http://lists.llvm.org/pipermail/cfe-dev/2019-April/061904.html mechanically to the cases where the output file is piped to `%diff_plist` via `tail`. `%diff_plist` is then, being unused, removed. The changes were applied via a script. Reviewers: NoQ, sfertile, xingxue, jasonliu, daltenty Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62951 llvm-svn: 362998
Diffstat (limited to 'clang')
-rw-r--r--clang/test/Analysis/MismatchedDeallocator-path-notes.cpp2
-rw-r--r--clang/test/Analysis/diagnostics/plist-diagnostics-include-check.cpp2
-rw-r--r--clang/test/Analysis/diagnostics/plist-multi-file.c2
-rw-r--r--clang/test/Analysis/lambda-notes.cpp2
-rw-r--r--clang/test/Analysis/lit.local.cfg5
-rw-r--r--clang/test/Analysis/malloc-plist.c2
6 files changed, 5 insertions, 10 deletions
diff --git a/clang/test/Analysis/MismatchedDeallocator-path-notes.cpp b/clang/test/Analysis/MismatchedDeallocator-path-notes.cpp
index 5529d495be8..6138af3399e 100644
--- a/clang/test/Analysis/MismatchedDeallocator-path-notes.cpp
+++ b/clang/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 -u %S/copypaste/Inputs/expected-plists/MismatchedDeallocator-path-notes.cpp.plist -
void changePointee(int *p);
int *allocIntArray(unsigned c) {
diff --git a/clang/test/Analysis/diagnostics/plist-diagnostics-include-check.cpp b/clang/test/Analysis/diagnostics/plist-diagnostics-include-check.cpp
index 26beda5300d..b91e4ad3e2d 100644
--- a/clang/test/Analysis/diagnostics/plist-diagnostics-include-check.cpp
+++ b/clang/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 -u %S/Inputs/expected-plists/plist-diagnostics-include-check.cpp.plist -
#include "Inputs/include/plist-diagnostics-include-check-macro.h"
diff --git a/clang/test/Analysis/diagnostics/plist-multi-file.c b/clang/test/Analysis/diagnostics/plist-multi-file.c
index f6ff8097ff0..aa26536f0ac 100644
--- a/clang/test/Analysis/diagnostics/plist-multi-file.c
+++ b/clang/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 -u %S/Inputs/expected-plists/plist-multi-file.c.plist -
#include "plist-multi-file.h"
diff --git a/clang/test/Analysis/lambda-notes.cpp b/clang/test/Analysis/lambda-notes.cpp
index e436068501c..0ae2d3efa28 100644
--- a/clang/test/Analysis/lambda-notes.cpp
+++ b/clang/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 -u %S/Inputs/expected-plists/lambda-notes.cpp.plist -
// Diagnostic inside a lambda
diff --git a/clang/test/Analysis/lit.local.cfg b/clang/test/Analysis/lit.local.cfg
index 936c2520f61..5c94b8b240d 100644
--- a/clang/test/Analysis/lit.local.cfg
+++ b/clang/test/Analysis/lit.local.cfg
@@ -9,11 +9,6 @@ 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
-# with reference output)
-config.substitutions.append(('%diff_plist',
- 'diff -u -w -I "<string>/" -I "<string>.:" -I "version"'))
-
# Filtering command used by Clang Analyzer tests (when comparing .plist files
# with reference output)
config.substitutions.append(('%normalize_plist',
diff --git a/clang/test/Analysis/malloc-plist.c b/clang/test/Analysis/malloc-plist.c
index 86a921db083..89e496150b3 100644
--- a/clang/test/Analysis/malloc-plist.c
+++ b/clang/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 -u %S/Inputs/expected-plists/malloc-plist.c.plist -
typedef __typeof(sizeof(int)) size_t;
void *malloc(size_t);
OpenPOWER on IntegriCloud