diff options
Diffstat (limited to 'test/Analysis/rdar-6582778-basic-store.c')
-rw-r--r-- | test/Analysis/rdar-6582778-basic-store.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Analysis/rdar-6582778-basic-store.c b/test/Analysis/rdar-6582778-basic-store.c new file mode 100644 index 0000000..9ec38ef --- /dev/null +++ b/test/Analysis/rdar-6582778-basic-store.c @@ -0,0 +1,22 @@ +// RUN: clang-cc -analyze -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 +} |