• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
5 // REQUIRES: staticanalyzer
6 
7 // CHECK: <h3>Annotated Source Code</h3>
8 
9 // Without tweaking expr, the expr would hit to the line below
10 // emitted to the output as comment.
11 // CHECK: {{[D]ereference of null pointer}}
12 
f0(int x)13 void f0(int x) {
14   int *p = &x;
15 
16   if (x > 10) {
17     if (x == 22)
18       p = 0;
19   }
20 
21   *p = 10;
22 }
23 
24 
25