2012-07-10 21:10:51 +08:00
|
|
|
// RUN: rm -rf %t
|
|
|
|
// RUN: mkdir %t
|
2018-09-14 20:24:09 +08:00
|
|
|
// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -DSECRET=XYZZY -c %/t/test.cpp\",\"file\":\"%/t/test.cpp\"}]" | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
|
2012-07-10 21:10:51 +08:00
|
|
|
// RUN: cp "%s" "%t/test.cpp"
|
2013-07-05 00:16:58 +08:00
|
|
|
// RUN: not clang-check "%t/test.cpp" 2>&1 | FileCheck %s
|
2012-07-10 21:10:51 +08:00
|
|
|
|
2018-09-14 20:24:09 +08:00
|
|
|
// 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
|