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