brintos

brintos / llvm-project-archived public Read only

0
0
Text · 442 B · 4d4f2b2 Raw
19 lines · plain
1// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify -Wno-objc-root-class %s2// expected-no-diagnostics3 4// Test reasoning about static locals in ObjCMethods. 5int *getValidPtr(void);6@interface Radar112758037- (int) useStaticInMethod;8@end9@implementation Radar1127580310 11- (int) useStaticInMethod12{13  static int *explInit = 0;14  static int implInit;15  if (!implInit)16    explInit = getValidPtr();17  return *explInit; //no-warning18}19@end