summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/infrastructure/read_file_config.cpp
blob: 3e39b4d630eb3b6f65bf1d4c4da46469be6a9387 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// REQUIRES: static-analyzer
// RUN: mkdir -p %T/read-file-config/
// RUN: cp %s %T/read-file-config/test.cpp
// RUN: echo 'Checks: "-*,modernize-use-nullptr"' > %T/read-file-config/.clang-tidy
// 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
// RUN: clang-tidy %T/read-file-config/test.cpp | not grep "warning: .*\[clang-analyzer-deadcode.DeadStores\]$"
// RUN: clang-tidy -checks="-*,clang-analyzer-*" %T/read-file-config/test.cpp | grep "warning: .*\[clang-analyzer-deadcode.DeadStores\]$"

void f() {
  int x;
  x = 1;
  x = 2;
}
OpenPOWER on IntegriCloud