Clang Project

clang_source_code/test/Tooling/clang-check-mac-libcxx-abspath.cpp
1// Clang on MacOS can find libc++ living beside the installed compiler.
2// This test makes sure our libTooling-based tools emulate this properly.
3//
4// RUN: rm -rf %t
5// RUN: mkdir %t
6//
7// Install the mock libc++ (simulates the libc++ directory structure).
8// RUN: cp -r %S/Inputs/mock-libcxx %t/
9//
10// Pretend clang is installed beside the mock library that we provided.
11// RUN: echo '[{"directory":"%t","command":"%t/mock-libcxx/bin/clang++ -stdlib=libc++ -target x86_64-apple-darwin -c test.cpp","file":"test.cpp"}]' | sed -e 's/\\/\//g' > %t/compile_commands.json
12// RUN: cp "%s" "%t/test.cpp"
13// clang-check will produce an error code if the mock library is not found.
14// RUN: clang-check -p "%t" "%t/test.cpp"
15
16#include <mock_vector>
17vector v;
18