[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Tooling / clang-check-set-analyzer-output-path.cpp
blobff5e86ae78924f638ec0f8f619d3e2e793e32f36
1 // RUN: rm -rf %t
2 // RUN: mkdir %t
3 // RUN: cd %t
4 // RUN: echo '[{"directory":".","command":"clang++ -c %t/test.cpp -o foo -ofoo","file":"%t/test.cpp"}]' | sed -e 's/\\/\//g' > %t/compile_commands.json
5 // RUN: cp "%s" "%t/test.cpp"
6 // RUN: echo '// CHECK: {{qwerty}}' > %t/cclog-check
7 // RUN: clang-check -p "%t" "%t/test.cpp" -analyze -analyzer-output-path=%t/qwerty -extra-arg=-v -extra-arg=-Xclang -extra-arg=-verify 2>&1 | FileCheck %t/cclog-check
8 // RUN: FileCheck %s --input-file=%t/qwerty
10 // CHECK: DOCTYPE plist
11 // CHECK: Division by zero
12 int f() {
13 return 1 / 0; // expected-warning {{Division by zero}}