summaryrefslogtreecommitdiffstats
path: root/test/pp-trace/pp-trace-filter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/pp-trace/pp-trace-filter.cpp')
-rw-r--r--test/pp-trace/pp-trace-filter.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/pp-trace/pp-trace-filter.cpp b/test/pp-trace/pp-trace-filter.cpp
new file mode 100644
index 00000000..1cd2ce7e
--- /dev/null
+++ b/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: [