diff options
| author | Ted Kremenek <kremenek@apple.com> | 2012-06-22 23:55:50 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2012-06-22 23:55:50 +0000 |
| commit | 72b3452c2b35b9c4c4163c1bb05a8aa60abd5cad (patch) | |
| tree | a409ed062d382e9e0d66af2ca1a04e74803a61fa /clang/test | |
| parent | 9cb8e9fc89d347c7e1cfe19a832e45188166a2d5 (diff) | |
| download | bcm5719-llvm-72b3452c2b35b9c4c4163c1bb05a8aa60abd5cad.tar.gz bcm5719-llvm-72b3452c2b35b9c4c4163c1bb05a8aa60abd5cad.zip | |
Implement initial static analysis inlining support for C++ methods.
llvm-svn: 159047
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Analysis/iterators.cpp | 3 | ||||
| -rw-r--r-- | clang/test/Analysis/misc-ps-region-store.cpp | 20 |
2 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/Analysis/iterators.cpp b/clang/test/Analysis/iterators.cpp index 1b6340b2af2..9d7ef32e91e 100644 --- a/clang/test/Analysis/iterators.cpp +++ b/clang/test/Analysis/iterators.cpp @@ -1,6 +1,9 @@ // RUN: %clang --analyze -Xclang -analyzer-checker=core,experimental.cplusplus.Iterators -Xclang -verify %s // XFAIL: win32 +// FIXME: Does not work with inlined C++ methods. +// XFAIL: * + #include <vector> void fum(std::vector<int>::iterator t); diff --git a/clang/test/Analysis/misc-ps-region-store.cpp b/clang/test/Analysis/misc-ps-region-store.cpp index 893e2983ca4..381aa033163 100644 --- a/clang/test/Analysis/misc-ps-region-store.cpp +++ b/clang/test/Analysis/misc-ps-region-store.cpp @@ -592,3 +592,23 @@ void rdar11401827() { } } +//===---------------------------------------------------------------------===// +// Handle inlining of C++ method calls. +//===---------------------------------------------------------------------===// + +struct A { + int *p; + void foo(int *q) { + p = q; + } + void bar() { + *p = 0; // expected-warning {{null pointer}} + } +}; + +void test_inline() { + A a; + a.foo(0); + a.bar(); +} + |

