summaryrefslogtreecommitdiffstats
path: root/test/Analysis/rdar-6582778-basic-store.c
blob: ff32372f44fcf2fbb31a489e03b344d899c9b380 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -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
}
OpenPOWER on IntegriCloud