inline.c revision 452b84ded735d7e7de6d099953ab959a4c9910f0
1// RUN: %clang_cc1 -analyze -inline-call -analyzer-store region -analyze-function f2 -verify %s
2
3int f1() {
4  int y = 1;
5  y++;
6  return y;
7}
8
9void f2() {
10  int x = 1;
11  x = f1();
12  if (x == 1) {
13    int *p = 0;
14    *p = 3; // no-warning
15  }
16  if (x == 2) {
17    int *p = 0;
18    *p = 3; // expected-warning{{Dereference of null pointer (loaded from variable 'p')}}
19  }
20}
21