Home | History | Annotate | Download | only in Analysis
      1 // RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -analyzer-store=basic -verify %s
      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 }
     23