]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Analysis/static_local.m
Vendor import of clang trunk r300422:
[FreeBSD/FreeBSD.git] / test / Analysis / static_local.m
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify -Wno-objc-root-class %s
2 // expected-no-diagnostics
3
4 // Test reasoning about static locals in ObjCMethods. 
5 int *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