Add test case for dead stores checker to not flag dead assignments to 'self' within...
authorTed Kremenek <kremenek@apple.com>
Tue, 1 Feb 2011 20:45:26 +0000 (20:45 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 1 Feb 2011 20:45:26 +0000 (20:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124681 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/dead-stores.m

index 730b8266bd10162a47e5bf80607ce3d76b5aa290..852e63afcda9ca54a9628e8d03c2fda374458744 100644 (file)
@@ -59,3 +59,20 @@ void foo_rdar8527823();
  }
 }
 @end
+
+// Don't flag dead stores to assignments to self within a nested assignment.
+@interface Rdar7947686
+- (id) init;
+@end
+
+@interface Rdar7947686_B : Rdar7947686
+- (id) init;
+@end
+
+@implementation Rdar7947686_B
+- (id) init {
+  id x = (self = [super init]); // no-warning
+  return x;
+}
+@end
+