From cc73504950eb7b5dff2dded9bedd67bc36d64641 Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 19 Aug 2012 10:33:04 +0000 Subject: Vendor import of clang trunk r162107: http://llvm.org/svn/llvm-project/cfe/trunk@162107 --- test/Analysis/method-call-path-notes.cpp | 85 ++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) (limited to 'test/Analysis/method-call-path-notes.cpp') diff --git a/test/Analysis/method-call-path-notes.cpp b/test/Analysis/method-call-path-notes.cpp index fbf0cae..17034b9 100644 --- a/test/Analysis/method-call-path-notes.cpp +++ b/test/Analysis/method-call-path-notes.cpp @@ -36,6 +36,11 @@ void test_ic_member_ptr() { (p->*bar)(); // expected-warning {{Called C++ object pointer is null}} expected-note{{Called C++ object pointer is null}} } +void test_cast(const TestInstanceCall *p) { + if (!p) // expected-note {{Assuming pointer value is null}} expected-note {{Taking true branch}} + const_cast(p)->foo(); // expected-warning {{Called C++ object pointer is null}} expected-note {{Called C++ object pointer is null}} +} + // CHECK: // CHECK: // CHECK: @@ -659,6 +664,86 @@ void test_ic_member_ptr() { // CHECK: file0 // CHECK: // CHECK: +// CHECK: +// CHECK: path +// CHECK: +// CHECK: +// CHECK: kindcontrol +// CHECK: edges +// CHECK: +// CHECK: +// CHECK: start +// CHECK: +// CHECK: +// CHECK: line40 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line40 +// CHECK: col4 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: end +// CHECK: +// CHECK: +// CHECK: line41 +// CHECK: col5 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line41 +// CHECK: col14 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: kindevent +// CHECK: location +// CHECK: +// CHECK: line41 +// CHECK: col5 +// CHECK: file0 +// CHECK: +// CHECK: ranges +// CHECK: +// CHECK: +// CHECK: +// CHECK: line41 +// CHECK: col5 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line41 +// CHECK: col37 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: +// CHECK: depth0 +// CHECK: extended_message +// CHECK: Called C++ object pointer is null +// CHECK: message +// CHECK: Called C++ object pointer is null +// CHECK: +// CHECK: +// CHECK: descriptionCalled C++ object pointer is null +// CHECK: categoryLogic error +// CHECK: typeCalled C++ object pointer is null +// CHECK: issue_context_kindfunction +// CHECK: issue_contexttest_cast +// CHECK: issue_hash2 +// CHECK: location +// CHECK: +// CHECK: line41 +// CHECK: col5 +// CHECK: file0 +// CHECK: +// CHECK: // CHECK: // CHECK: // CHECK: -- cgit v1.1