blob: 2f7f29c5d9e4a258970c9b1df2f6eedb2eb0ba86 [file] [log] [blame]
Ted Kremenek565e4652010-02-05 02:06:54 +00001// 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
Ted Kremenekfb8a7fd2008-09-19 20:53:52 +00003
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}