1 // RUN: %clang_analyze_cc1 -verify -Wno-objc-root-class %s \
2 // RUN: -analyzer-checker=core,osx.cocoa.RetainCount
5 #define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
6 #define CF_CONSUMED __attribute__((cf_consumed))
8 void clang_analyzer_eval(int);
10 typedef const void *CFTypeRef;
12 extern CFTypeRef CFCreate(void) CF_RETURNS_RETAINED;
13 extern CFTypeRef CFRetain(CFTypeRef cf);
14 extern void CFRelease(CFTypeRef cf);
16 void bar(CFTypeRef *v) {}
19 CFTypeRef *values = (CFTypeRef[]){
20 CFCreate(), // no-warning
21 CFCreate(), // expected-warning{{leak}}
22 CFCreate()}; // no-warning