freebsd-dev/test/Analysis/rdar-6582778-basic-store.c
2009-12-15 18:49:47 +00:00

23 lines
695 B
C

// RUN: clang -cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
typedef const void * CFTypeRef;
typedef double CFTimeInterval;
typedef CFTimeInterval CFAbsoluteTime;
typedef const struct __CFAllocator * CFAllocatorRef;
typedef const struct __CFDate * CFDateRef;
extern CFDateRef CFDateCreate(CFAllocatorRef allocator, CFAbsoluteTime at);
CFAbsoluteTime CFAbsoluteTimeGetCurrent(void);
void f(void) {
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
CFTypeRef vals[] = { CFDateCreate(0, t) }; // no-warning
}
CFTypeRef global;
void g(void) {
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
global = CFDateCreate(0, t); // no-warning
}