summaryrefslogtreecommitdiff
path: root/test/Tooling
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2017-08-18 16:34:22 +0000
committerJohannes Altmanninger <aclopte@gmail.com>2017-08-18 16:34:22 +0000
commit3c9f486dfd8d87757e064908ce8881a4a710ff8b (patch)
tree2353b822d3a6875e944e1299f6205c4dacda685b /test/Tooling
parent7fe9c979c5ab07417d9b9424cf3d3640172bcc13 (diff)
downloadclang-3c9f486dfd8d87757e064908ce8881a4a710ff8b.tar.gz
[clang-diff] Add commandline arguments.
Summary: Support command line options for build path and extra arguments This emulates the options accepted by clang tools that use CommonOptionsParser. Add a flag for controlling the maximum size parameter for bottom up matching. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36177 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311173 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Tooling')
-rw-r--r--test/Tooling/clang-diff-args.test8
-rw-r--r--test/Tooling/clang-diff-basic.cpp7
2 files changed, 11 insertions, 4 deletions
diff --git a/test/Tooling/clang-diff-args.test b/test/Tooling/clang-diff-args.test
new file mode 100644
index 0000000000..a051c3ba79
--- /dev/null
+++ b/test/Tooling/clang-diff-args.test
@@ -0,0 +1,8 @@
+RUN: echo a > %t.cpp
+
+CHECK: unknown type name 'X'
+
+check adding compiler cflags
+RUN: clang-diff -ast-dump -extra-arg=-Da=X %t.cpp -- 2>&1 | FileCheck %s
+RUN: clang-diff -ast-dump -extra-arg-before=-Da=X %t.cpp -- 2>&1 | FileCheck %s
+RUN: clang-diff -ast-dump %t.cpp -- 2>&1 -Da=X | FileCheck %s
diff --git a/test/Tooling/clang-diff-basic.cpp b/test/Tooling/clang-diff-basic.cpp
index e23abbd4ce..ac676991e9 100644
--- a/test/Tooling/clang-diff-basic.cpp
+++ b/test/Tooling/clang-diff-basic.cpp
@@ -1,7 +1,6 @@
-// RUN: mkdir -p %t
-// RUN: %clang_cc1 -E %s > %t/src.cpp
-// RUN: %clang_cc1 -E %s > %t/dst.cpp -DDEST
-// RUN: clang-diff -no-compilation-database %t/src.cpp %t/dst.cpp | FileCheck %s
+// RUN: %clang_cc1 -E %s > %t.src.cpp
+// RUN: %clang_cc1 -E %s > %t.dst.cpp -DDEST
+// RUN: clang-diff %t.src.cpp %t.dst.cpp -- | FileCheck %s
#ifndef DEST
namespace src {