diff --git a/test/Analysis/uninit-vals.m b/test/Analysis/uninit-vals.m new file mode 100644 index 0000000000..74aa667202 --- /dev/null +++ b/test/Analysis/uninit-vals.m @@ -0,0 +1,24 @@ +// RUN: clang -checker-cfref -verify %s + +typedef unsigned int NSUInteger; + +@interface A +- (NSUInteger)foo; +@end + +NSUInteger f8(A* x){ + const NSUInteger n = [x foo]; + int* bogus; + + if (n > 0) { // tests const cast transfer function logic + NSUInteger i; + + for (i = 0; i < n; ++i) + bogus = 0; + + if (bogus) // no-warning + return n+1; + } + + return n; +}