aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Analysis/method-call.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Analysis/method-call.cpp b/test/Analysis/method-call.cpp
index 8c6b9da0f4..b5b81e3402 100644
--- a/test/Analysis/method-call.cpp
+++ b/test/Analysis/method-call.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-inline-call -analyzer-store region -verify %s
+// XFAIL: *
struct A {
int x;
@@ -28,3 +29,13 @@ void f2() {
}
}
+void f3() {
+ const A &x = (A)3;
+ if (x.getx() == 3) {
+ int *p = 0;
+ *p = 3; // expected-warning{{Dereference of null pointer}}
+ } else {
+ int *p = 0;
+ *p = 3; // no-warning
+ }
+}