summaryrefslogtreecommitdiff
path: root/test/Analysis/uninit-vals.m
blob: 43bab9e79134e8488efb95df74d0f997b1d0a6e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// RUN: clang -cc1 -analyze -checker-cfref -analyzer-store=basic -verify %s
// RUN: clang -cc1 -analyze -checker-cfref -analyzer-store=region -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;
}