uninit-vals.m revision a4c7a4314ffbe402091695874e93d9b0a79c8099
1// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s 2 3typedef unsigned int NSUInteger; 4 5@interface A 6- (NSUInteger)foo; 7@end 8 9NSUInteger f8(A* x){ 10 const NSUInteger n = [x foo]; 11 int* bogus; 12 13 if (n > 0) { // tests const cast transfer function logic 14 NSUInteger i; 15 16 for (i = 0; i < n; ++i) 17 bogus = 0; 18 19 if (bogus) // no-warning 20 return n+1; 21 } 22 23 return n; 24} 25 26 27// PR10163 -- don't warn for default-initialized float arrays. 28// (An additional test is in uninit-vals-ps-region.m) 29void test_PR10163(float); 30void PR10163 (void) { 31 float x[2] = {0}; 32 test_PR10163(x[1]); // no-warning 33} 34