xref: /llvm-project/clang/test/Tooling/fixed-database.cpp (revision 48aa781ae44a611967084ca031fdbb3a0712c40c)
160d74e45SSam McCall // RUN: rm -rf %t
260d74e45SSam McCall // RUN: mkdir -p %t/Src
360d74e45SSam McCall // RUN: cp "%s" "%t/Src/test.cpp"
460d74e45SSam McCall // RUN: mkdir -p %t/Include
560d74e45SSam McCall // RUN: cp "%S/Inputs/fixed-header.h" "%t/Include/"
660d74e45SSam McCall // -I flag is relative to %t (where compile_flags is), not Src/.
760d74e45SSam McCall // RUN: echo '-IInclude/' >> %t/compile_flags.txt
860d74e45SSam McCall // RUN: echo "  -Dklazz=class   " >> %t/compile_flags.txt
960d74e45SSam McCall // RUN: echo '-std=c++11' >> %t/compile_flags.txt
1060d74e45SSam McCall // RUN: clang-check "%t/Src/test.cpp" 2>&1
11*ed1b3f71SSam McCall // RUN: echo > %t/compile_flags.txt
12*ed1b3f71SSam McCall // RUN: not clang-check "%t/Src/test.cpp" 2>&1 | FileCheck "%s" -check-prefix=NODB
1360d74e45SSam McCall 
1460d74e45SSam McCall // NODB: unknown type name 'klazz'
1560d74e45SSam McCall klazz F{};
1660d74e45SSam McCall 
1760d74e45SSam McCall // NODB: 'fixed-header.h' file not found
1860d74e45SSam McCall #include "fixed-header.h"
1960d74e45SSam McCall static_assert(SECRET_SYMBOL == 1, "");
20