summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/inline.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-08-15 21:05:15 +0000
committerJordan Rose <jordan_rose@apple.com>2012-08-15 21:05:15 +0000
commite9753b06401bc00694c496a569352db1276f1bb1 (patch)
treecb8631e93371b52ca72a74b0ae0e6906e9922dc7 /clang/test/Analysis/inline.cpp
parentaa7c1cb5f8b2de3f4d77ce0e0d5d94dc40768a47 (diff)
downloadbcm5719-llvm-e9753b06401bc00694c496a569352db1276f1bb1.tar.gz
bcm5719-llvm-e9753b06401bc00694c496a569352db1276f1bb1.zip
[analyzer] Even if we are not inlining a virtual call, still invalidate!
Fixes a mistake introduced in r161916. llvm-svn: 161987
Diffstat (limited to 'clang/test/Analysis/inline.cpp')
-rw-r--r--clang/test/Analysis/inline.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/Analysis/inline.cpp b/clang/test/Analysis/inline.cpp
index 4eaed9fed13..6b9a885f50f 100644
--- a/clang/test/Analysis/inline.cpp
+++ b/clang/test/Analysis/inline.cpp
@@ -166,3 +166,30 @@ namespace PR13569_virtual {
x.interface();
}
}
+
+namespace Invalidation {
+ struct X {
+ void touch(int &x) const {
+ x = 0;
+ }
+
+ void touch2(int &x) const;
+
+ virtual void touchV(int &x) const {
+ x = 0;
+ }
+
+ virtual void touchV2(int &x) const;
+
+ int test() const {
+ // We were accidentally not invalidating under -analyzer-ipa=inlining
+ // at one point for virtual methods with visible definitions.
+ int a, b, c, d;
+ touch(a);
+ touch2(b);
+ touchV(c);
+ touchV2(d);
+ return a + b + c + d; // no-warning
+ }
+ };
+}
OpenPOWER on IntegriCloud