xref: /aosp_15_r20/external/clang/test/Tooling/clang-check-chdir.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // Verifies that paths are resolved relatively to the directory specified in the
2*67e74705SXin Li // compilation database.
3*67e74705SXin Li // RUN: rm -rf %t
4*67e74705SXin Li // RUN: mkdir %t
5*67e74705SXin Li // RUN: echo "[{\"directory\":\"%t\",\"command\":\"clang -c test.cpp -I.\",\"file\":\"%t/test.cpp\"}]" | sed -e 's/\\/\//g' > %t/compile_commands.json
6*67e74705SXin Li // RUN: cp "%s" "%t/test.cpp"
7*67e74705SXin Li // RUN: touch "%t/clang-check-test.h"
8*67e74705SXin Li // RUN: not clang-check -p "%t" "%t/test.cpp" 2>&1|FileCheck %s
9*67e74705SXin Li // FIXME: Make the above easier.
10*67e74705SXin Li 
11*67e74705SXin Li #include "clang-check-test.h"
12*67e74705SXin Li 
13*67e74705SXin Li // CHECK: C++ requires
14*67e74705SXin Li invalid;
15