summaryrefslogtreecommitdiffstats
path: root/clang/test/Tooling/auto-detect-from-source.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Tooling/auto-detect-from-source.cpp')
-rw-r--r--clang/test/Tooling/auto-detect-from-source.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/test/Tooling/auto-detect-from-source.cpp b/clang/test/Tooling/auto-detect-from-source.cpp
index 12a660d585a..e6241a9ec3e 100644
--- a/clang/test/Tooling/auto-detect-from-source.cpp
+++ b/clang/test/Tooling/auto-detect-from-source.cpp
@@ -1,8 +1,12 @@
// RUN: rm -rf %t
// RUN: mkdir %t
-// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -c %/t/test.cpp\",\"file\":\"%/t/test.cpp\"}]" | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
+// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -DSECRET=XYZZY -c %/t/test.cpp\",\"file\":\"%/t/test.cpp\"}]" | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
// RUN: not clang-check "%t/test.cpp" 2>&1 | FileCheck %s
-// CHECK: C++ requires
-invalid;
+// CHECK: XYZZY
+SECRET;
+
+// Copy to a different file, and rely on the command being inferred.
+// RUN: cp "%s" "%t/other.cpp"
+// RUN: not clang-check "%t/other.cpp" 2>&1 | FileCheck %s
OpenPOWER on IntegriCloud