Ted Kremenek | 8382cf5 | 2009-11-13 18:46:29 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s |
Ted Kremenek | 5216ad7 | 2009-02-14 03:16:10 +0000 | [diff] [blame] | 2 | |
| 3 | typedef const void * CFTypeRef; |
| 4 | typedef double CFTimeInterval; |
| 5 | typedef CFTimeInterval CFAbsoluteTime; |
| 6 | typedef const struct __CFAllocator * CFAllocatorRef; |
| 7 | typedef const struct __CFDate * CFDateRef; |
| 8 | |
| 9 | extern CFDateRef CFDateCreate(CFAllocatorRef allocator, CFAbsoluteTime at); |
| 10 | CFAbsoluteTime CFAbsoluteTimeGetCurrent(void); |
| 11 | |
| 12 | void f(void) { |
| 13 | CFAbsoluteTime t = CFAbsoluteTimeGetCurrent(); |
| 14 | CFTypeRef vals[] = { CFDateCreate(0, t) }; // no-warning |
| 15 | } |
| 16 | |
| 17 | CFTypeRef global; |
| 18 | |
| 19 | void g(void) { |
| 20 | CFAbsoluteTime t = CFAbsoluteTimeGetCurrent(); |
| 21 | global = CFDateCreate(0, t); // no-warning |
| 22 | } |