[Heikki Kultala] This patch contains the ABI changes for the TCE target.
[clang.git] / test / Analysis / method-call.cpp
blob8c6b9da0f40163d8026b30a6a5673c65f84b16c3
1 // RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-inline-call -analyzer-store region -verify %s
3 struct A {
4 int x;
5 A(int a) { x = a; }
6 int getx() const { return x; }
7 };
9 void f1() {
10 A x(3);
11 if (x.getx() == 3) {
12 int *p = 0;
13 *p = 3; // expected-warning{{Dereference of null pointer}}
14 } else {
15 int *p = 0;
16 *p = 3; // no-warning
20 void f2() {
21 const A &x = A(3);
22 if (x.getx() == 3) {
23 int *p = 0;
24 *p = 3; // expected-warning{{Dereference of null pointer}}
25 } else {
26 int *p = 0;
27 *p = 3; // no-warning