html-diagnostics.c 481 B

123456789101112131415161718192021222324
  1. // RUN: rm -rf %t
  2. // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t %s
  3. // RUN: find %t -name "*.html" -exec cat "{}" ";" | FileCheck %s
  4. // REQUIRES: staticanalyzer
  5. // CHECK: <h3>Annotated Source Code</h3>
  6. // Without tweaking expr, the expr would hit to the line below
  7. // emitted to the output as comment.
  8. // CHECK: {{[D]ereference of null pointer}}
  9. void f0(int x) {
  10. int *p = &x;
  11. if (x > 10) {
  12. if (x == 22)
  13. p = 0;
  14. }
  15. *p = 10;
  16. }