diff options
| author | Ted Kremenek <kremenek@apple.com> | 2011-04-02 02:56:23 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2011-04-02 02:56:23 +0000 |
| commit | 8f89f7c89331594e308bbac9fc4220cba866a744 (patch) | |
| tree | edad6b72ca91f9f213c64b91abfb7ec67c420304 /clang/test/Analysis | |
| parent | c703a666f7a3042a4b9b7211e6262c2134dd61d2 (diff) | |
| download | bcm5719-llvm-8f89f7c89331594e308bbac9fc4220cba866a744.tar.gz bcm5719-llvm-8f89f7c89331594e308bbac9fc4220cba866a744.zip | |
Teach IdempotentOperationsChecker about paths aborted because ExprEngine didn't know how to handle a specific Expr type.
llvm-svn: 128761
Diffstat (limited to 'clang/test/Analysis')
| -rw-r--r-- | clang/test/Analysis/idempotent-operations.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/Analysis/idempotent-operations.cpp b/clang/test/Analysis/idempotent-operations.cpp index f9240eb61aa..9d22909ed37 100644 --- a/clang/test/Analysis/idempotent-operations.cpp +++ b/clang/test/Analysis/idempotent-operations.cpp @@ -13,3 +13,22 @@ void false1() { test(five * a); // expected-warning {{The right operand to '*' is always 0}} b = 4; } + +// Test not flagging idempotent operations because we aborted the analysis +// of a path because of an unsupported construct. +struct RDar9219143_Foo { + ~RDar9219143_Foo(); + operator bool() const; +}; + +RDar9219143_Foo foo(); +unsigned RDar9219143_bar(); +void RDar9219143_test() { + unsigned i, e; + for (i = 0, e = RDar9219143_bar(); i != e; ++i) + if (foo()) + break; + if (i == e) // no-warning + return; +} + |

