brintos

brintos / llvm-project-archived public Read only

0
0
Text · 667 B · 48880b5 Raw
13 lines · c
1// RUN: rm -rf %t && mkdir %t2// RUN: %clang_analyze_cc1 -analyzer-checker=core %s -verify -analyzer-output=sarif-html -o %t%{fs-sep}out1.sarif3// RUN: %clang_analyze_cc1 -analyzer-checker=core %s -verify -analyzer-output=sarif-html -o %t%{fs-sep}out2.sarif4// 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 7int test(int *p) {8  if (p)9    return 0;10  else11    return *p;  // expected-warning {{Dereference of null pointer (loaded from variable 'p')}}12}13