Debian Codegraph @

clang/test/Analysis/diagnostics/sarif-multi-file-diagnostics.c

raw
1 // RUN: rm -rf %t && mkdir %t
2 // RUN: %clang_analyze_cc1 -analyzer-checker=core %s -verify -analyzer-output=sarif-html -o %t%{fs-sep}out1.sarif
3 // RUN: %clang_analyze_cc1 -analyzer-checker=core %s -verify -analyzer-output=sarif-html -o %t%{fs-sep}out2.sarif
4 // RUN: cat %t%{fs-sep}out1.sarif | %normalize_sarif | diff -U1 -b %S/Inputs/expected-sarif/sarif-multi-file-diagnostics.c.sarif -
5 // RUN: cat %t%{fs-sep}out2.sarif | %normalize_sarif | diff -U1 -b %S/Inputs/expected-sarif/sarif-multi-file-diagnostics.c.sarif -
6
7 int test(int *p) {
8 if (p)
9 return 0;
10 else
11 return *p; // expected-warning {{Dereference of null pointer (loaded from variable 'p')}}
12 }