blob: 6d1561eeb51196aac33c8c5017cbcb448efdbc0a [file] [log] [blame]
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00001// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s
Daniel Dunbard7d5f022009-03-24 02:24:46 +00002// RUN: clang-cc -analyze -checker-cfref -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}