1// Clang on MacOS can find libc++ living beside the installed compiler.
2// This test makes sure clang-tidy emulates 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++ -std=c++11 -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// RUN: clang-tidy -header-filter='.*' -system-headers -checks='-*,modernize-use-using' "%t/test.cpp" | FileCheck %s
14// CHECK: mock_vector:{{[0-9]+}}:{{[0-9]+}}: warning: use 'using' instead of 'typedef'
15
16#include <mock_vector>
17typedef vector* vec_ptr;
18

source code of clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-mac-libcxx.cpp