xref: /llvm-project/clang/test/Tooling/clang-check-analyze-save-temps.cpp (revision bba729af3ef803c35c082417f89a1ac89462e22b)
1 // Check whether output generation options (like -save-temps) will not affect
2 // the execution of the analyzer.
3 
4 // RUN: clang-check -analyze %s -- -save-temps -c -Xclang -verify
5 
6 // Check whether redundant -fsyntax-only options will affect the execution of
7 // the analyzer.
8 
9 // RUN: clang-check -analyze %s -- \
10 // RUN:   -fsyntax-only -c -fsyntax-only -Xclang -verify 2>&1 | \
11 // RUN:   FileCheck %s --allow-empty
12 
13 // CHECK-NOT: argument unused during compilation: '--analyze'
14 
a(int * x)15 void a(int *x) {
16   if (x) {
17   }
18   *x = 47; // expected-warning {{Dereference of null pointer}}
19 }
20