xref: /aosp_15_r20/external/clang/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: rm -rf %t
2*67e74705SXin Li // RUN: mkdir -p %t/abc/def/ijk/qwe
3*67e74705SXin Li // RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -c %t/abc/def/ijk/qwe/test.cpp\",\"file\":\"%t/abc/def/ijk/qwe/test.cpp\"}]" | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
4*67e74705SXin Li // RUN: cp "%s" "%t/abc/def/ijk/qwe/test.cpp"
5*67e74705SXin Li // RUN: ln -sf %t/abc/def %t/abc/def2
6*67e74705SXin Li // RUN: cd %t/abc/def2
7*67e74705SXin Li // RUN: not env PWD="%t/abc/def" clang-check "ijk/qwe/test.cpp" 2>&1 | FileCheck %s
8*67e74705SXin Li 
9*67e74705SXin Li // CHECK: C++ requires
10*67e74705SXin Li // CHECK: /abc/def/ijk/qwe/test.cpp
11*67e74705SXin Li invalid;
12*67e74705SXin Li 
13*67e74705SXin Li // REQUIRES: shell
14