bolt/deps/llvm-18.1.8/clang/test/Analysis/static_local.m

19 lines
442 B
Mathematica
Raw Normal View History

2025-02-14 19:21:04 +01:00
// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify -Wno-objc-root-class %s
// expected-no-diagnostics
// Test reasoning about static locals in ObjCMethods.
int *getValidPtr(void);
@interface Radar11275803
- (int) useStaticInMethod;
@end
@implementation Radar11275803
- (int) useStaticInMethod
{
static int *explInit = 0;
static int implInit;
if (!implInit)
explInit = getValidPtr();
return *explInit; //no-warning
}
@end