uninit-vals.m revision 565e465c6d0093f1bf8414b2cabdc842022385a9
1// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-store=basic -verify %s 2// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-store=region -verify %s 3 4typedef unsigned int NSUInteger; 5 6@interface A 7- (NSUInteger)foo; 8@end 9 10NSUInteger f8(A* x){ 11 const NSUInteger n = [x foo]; 12 int* bogus; 13 14 if (n > 0) { // tests const cast transfer function logic 15 NSUInteger i; 16 17 for (i = 0; i < n; ++i) 18 bogus = 0; 19 20 if (bogus) // no-warning 21 return n+1; 22 } 23 24 return n; 25} 26