static_local.m revision 5fc1d0c4532c55cc47ba6628f296bf5b86d2eaf0
1// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -Wno-objc-root-class %s 2 3// Test reasoning about static locals in ObjCMethods. 4int *getValidPtr(); 5@interface Radar11275803 6- (int) useStaticInMethod; 7@end 8@implementation Radar11275803 9 10- (int) useStaticInMethod 11{ 12 static int *explInit = 0; 13 static int implInit; 14 if (!implInit) 15 explInit = getValidPtr(); 16 return *explInit; //no-warning 17} 18@end