| 1 | // REQUIRES: static-analyzer |
| 2 | // RUN: mkdir -p %T/read-file-config/ |
| 3 | // RUN: cp %s %T/read-file-config/test.cpp |
| 4 | // RUN: echo 'Checks: "-*,modernize-use-nullptr"' > %T/read-file-config/.clang-tidy |
| 5 | // RUN: echo '[{"command": "cc -c -o test.o test.cpp", "directory": "%/T/read-file-config", "file": "%/T/read-file-config/test.cpp"}]' > %T/read-file-config/compile_commands.json |
| 6 | // RUN: clang-tidy %T/read-file-config/test.cpp | not grep "warning: .*\[clang-analyzer-deadcode.DeadStores\]$" |
| 7 | // RUN: clang-tidy -checks="-*,clang-analyzer-*" %T/read-file-config/test.cpp | grep "warning: .*\[clang-analyzer-deadcode.DeadStores\]$" |
| 8 | |
| 9 | void f() { |
| 10 | int x; |
| 11 | x = 1; |
| 12 | x = 2; |
| 13 | } |
| 14 | |