summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/pp-trace
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-03-18 13:30:17 +0000
committerFangrui Song <maskray@google.com>2019-03-18 13:30:17 +0000
commit560a45a3c4f0b8543aa47fbb97cb66eeddcd029d (patch)
tree8a1b3fe41406a37c75b4cb696d6e2425373ba75f /clang-tools-extra/test/pp-trace
parent23629385f10d952aadad4f829c936ae879436386 (diff)
downloadbcm5719-llvm-560a45a3c4f0b8543aa47fbb97cb66eeddcd029d.tar.gz
bcm5719-llvm-560a45a3c4f0b8543aa47fbb97cb66eeddcd029d.zip
[pp-trace] Delete -ignore and add a new option -callbacks
Summary: -ignore specifies a list of PP callbacks to ignore. It cannot express a whitelist, which may be more useful than a blacklist. Add a new option -callbacks to replace it. -ignore= (default) => -callbacks='*' (default) -ignore=FileChanged,FileSkipped => -callbacks='*,-FileChanged,-FileSkipped' -callbacks='Macro*' : print only MacroDefined,MacroExpands,MacroUndefined,... Reviewers: juliehockett, aaron.ballman, alexfh, ioeric Reviewed By: aaron.ballman Subscribers: nemanjai, kbarton, jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59296 llvm-svn: 356366
Diffstat (limited to 'clang-tools-extra/test/pp-trace')
-rw-r--r--clang-tools-extra/test/pp-trace/pp-trace-conditional.cpp2
-rw-r--r--clang-tools-extra/test/pp-trace/pp-trace-filter.cpp17
-rw-r--r--clang-tools-extra/test/pp-trace/pp-trace-ident.cpp2
-rw-r--r--clang-tools-extra/test/pp-trace/pp-trace-macro.cpp2
-rw-r--r--clang-tools-extra/test/pp-trace/pp-trace-modules.cpp2
-rw-r--r--clang-tools-extra/test/pp-trace/pp-trace-pragma-general.cpp2
-rw-r--r--clang-tools-extra/test/pp-trace/pp-trace-pragma-ms.cpp2
-rw-r--r--clang-tools-extra/test/pp-trace/pp-trace-pragma-opencl.cpp2
8 files changed, 24 insertions, 7 deletions
diff --git a/clang-tools-extra/test/pp-trace/pp-trace-conditional.cpp b/clang-tools-extra/test/pp-trace/pp-trace-conditional.cpp
index 8e7ce8873c1..7787c5862dd 100644
--- a/clang-tools-extra/test/pp-trace/pp-trace-conditional.cpp
+++ b/clang-tools-extra/test/pp-trace/pp-trace-conditional.cpp
@@ -1,4 +1,4 @@
-// RUN: pp-trace -ignore FileChanged %s -undef -target x86_64 -std=c++11 | FileCheck --strict-whitespace %s
+// RUN: pp-trace -callbacks '*,-FileChanged' %s -undef -target x86_64 -std=c++11 | FileCheck --strict-whitespace %s
#if 1
#endif
diff --git a/clang-tools-extra/test/pp-trace/pp-trace-filter.cpp b/clang-tools-extra/test/pp-trace/pp-trace-filter.cpp
new file mode 100644
index 00000000000..915945eaffd
--- /dev/null
+++ b/clang-tools-extra/test/pp-trace/pp-trace-filter.cpp
@@ -0,0 +1,17 @@
+// RUN: pp-trace -callbacks 'File*,Macro*,-MacroUndefined' %s | FileCheck %s
+// RUN: pp-trace -callbacks ' File* , Macro* , -MacroUndefined ' %s | FileCheck %s
+// RUN: not pp-trace -callbacks '[' %s 2>&1 | FileCheck --check-prefix=INVALID %s
+
+#define M 1
+int i = M;
+#undef M
+
+// CHECK: ---
+// CHECK: - Callback: FileChanged
+// CHECK: - Callback: MacroDefined
+// CHECK: - Callback: MacroExpands
+// CHECK-NOT: - Callback: MacroUndefined
+// CHECK-NOT: - Callback: EndOfMainFile
+// CHECK: ...
+
+// INVALID: error: invalid glob pattern: [
diff --git a/clang-tools-extra/test/pp-trace/pp-trace-ident.cpp b/clang-tools-extra/test/pp-trace/pp-trace-ident.cpp
index 9981c39e60e..8c93c7280f3 100644
--- a/clang-tools-extra/test/pp-trace/pp-trace-ident.cpp
+++ b/clang-tools-extra/test/pp-trace/pp-trace-ident.cpp
@@ -1,4 +1,4 @@
-// RUN: pp-trace -ignore FileChanged,MacroDefined %s -undef -target x86_64 -std=c++11 | FileCheck --strict-whitespace %s
+// RUN: pp-trace -callbacks '*,-FileChanged,-MacroDefined' %s -undef -target x86_64 -std=c++11 | FileCheck --strict-whitespace %s
#ident "$Id$"
diff --git a/clang-tools-extra/test/pp-trace/pp-trace-macro.cpp b/clang-tools-extra/test/pp-trace/pp-trace-macro.cpp
index 1202aa20c8e..bd711e9e778 100644
--- a/clang-tools-extra/test/pp-trace/pp-trace-macro.cpp
+++ b/clang-tools-extra/test/pp-trace/pp-trace-macro.cpp
@@ -1,4 +1,4 @@
-// RUN: pp-trace -ignore FileChanged %s -undef -target x86_64 -std=c++11 | FileCheck --strict-whitespace %s
+// RUN: pp-trace -callbacks '*,-FileChanged' %s -undef -target x86_64 -std=c++11 | FileCheck --strict-whitespace %s
#define MACRO 1
int i = MACRO;
diff --git a/clang-tools-extra/test/pp-trace/pp-trace-modules.cpp b/clang-tools-extra/test/pp-trace/pp-trace-modules.cpp
index 5e9e1de3462..bfe376e2021 100644
--- a/clang-tools-extra/test/pp-trace/pp-trace-modules.cpp
+++ b/clang-tools-extra/test/pp-trace/pp-trace-modules.cpp
@@ -1,5 +1,5 @@
// RUN: rm -rf %t
-// RUN: pp-trace -ignore FileChanged,MacroDefined %s -x objective-c++ -undef -target x86_64 -std=c++11 -fmodules -fcxx-modules -fmodules-cache-path=%t -I%S -I%S/Input | FileCheck --strict-whitespace %s
+// RUN: pp-trace -callbacks '*,-FileChanged,-MacroDefined' %s -x objective-c++ -undef -target x86_64 -std=c++11 -fmodules -fcxx-modules -fmodules-cache-path=%t -I%S -I%S/Input | FileCheck --strict-whitespace %s
// CHECK: ---
diff --git a/clang-tools-extra/test/pp-trace/pp-trace-pragma-general.cpp b/clang-tools-extra/test/pp-trace/pp-trace-pragma-general.cpp
index 6caef0b6074..75c53984c2b 100644
--- a/clang-tools-extra/test/pp-trace/pp-trace-pragma-general.cpp
+++ b/clang-tools-extra/test/pp-trace/pp-trace-pragma-general.cpp
@@ -1,4 +1,4 @@
-// RUN: pp-trace -ignore FileChanged,MacroDefined %s | FileCheck --strict-whitespace %s
+// RUN: pp-trace -callbacks '*,-FileChanged,-MacroDefined' %s | FileCheck --strict-whitespace %s
#pragma clang diagnostic push
#pragma clang diagnostic pop
diff --git a/clang-tools-extra/test/pp-trace/pp-trace-pragma-ms.cpp b/clang-tools-extra/test/pp-trace/pp-trace-pragma-ms.cpp
index 33c9f7faa16..31a757b91fc 100644
--- a/clang-tools-extra/test/pp-trace/pp-trace-pragma-ms.cpp
+++ b/clang-tools-extra/test/pp-trace/pp-trace-pragma-ms.cpp
@@ -1,4 +1,4 @@
-// RUN: pp-trace -ignore FileChanged,MacroDefined %s -target x86_64-unknown-windows-msvc -fms-extensions -w | FileCheck --strict-whitespace %s
+// RUN: pp-trace -callbacks '*,-FileChanged,-MacroDefined' %s -target x86_64-unknown-windows-msvc -fms-extensions -w | FileCheck --strict-whitespace %s
#pragma comment(compiler, "compiler comment")
#pragma comment(exestr, "exestr comment")
diff --git a/clang-tools-extra/test/pp-trace/pp-trace-pragma-opencl.cpp b/clang-tools-extra/test/pp-trace/pp-trace-pragma-opencl.cpp
index cfd72c0d464..413b5d07b3c 100644
--- a/clang-tools-extra/test/pp-trace/pp-trace-pragma-opencl.cpp
+++ b/clang-tools-extra/test/pp-trace/pp-trace-pragma-opencl.cpp
@@ -1,4 +1,4 @@
-// RUN: pp-trace -ignore FileChanged,MacroDefined %s -x cl | FileCheck --strict-whitespace %s
+// RUN: pp-trace -callbacks '*,-FileChanged,-MacroDefined' %s -x cl | FileCheck --strict-whitespace %s
#pragma OPENCL EXTENSION all : disable
#pragma OPENCL EXTENSION cl_khr_int64_base_atomics : disable
OpenPOWER on IntegriCloud