blob: dcd49e11a16c677b9e551e46fb2871aeabcb0b21 [file] [log] [blame]
Anna Zaks5fc1d0c2012-09-17 19:13:56 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -Wno-objc-root-class %s
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00002// expected-no-diagnostics
Anna Zaks5fc1d0c2012-09-17 19:13:56 +00003
4// Test reasoning about static locals in ObjCMethods.
5int *getValidPtr();
6@interface Radar11275803
7- (int) useStaticInMethod;
8@end
9@implementation Radar11275803
10
11- (int) useStaticInMethod
12{
13 static int *explInit = 0;
14 static int implInit;
15 if (!implInit)
16 explInit = getValidPtr();
17 return *explInit; //no-warning
18}
19@end