CFContainers-invalid.c revision bc9e5ffb0d0757238c071764e4bc1fc8a1521097
1// RUN: %clang_cc1 -analyze -analyzer-checker=osx.coreFoundation.containers.PointerSizedValues -triple x86_64-apple-darwin -verify %s
2
3typedef const struct __CFAllocator * CFAllocatorRef;
4typedef const struct __CFArray * CFArrayRef;
5typedef const struct __CFDictionary * CFDictionaryRef;
6typedef const struct __CFSet * CFSetRef;
7
8extern const CFAllocatorRef kCFAllocatorDefault;
9
10// Unexpected declarations for these:
11CFArrayRef CFArrayCreate(CFAllocatorRef);
12CFDictionaryRef CFDictionaryCreate(CFAllocatorRef);
13CFSetRef CFSetCreate(CFAllocatorRef);
14
15void testNoCrash() {
16  (void)CFArrayCreate(kCFAllocatorDefault);
17  (void)CFDictionaryCreate(kCFAllocatorDefault);
18  (void)CFSetCreate(kCFAllocatorDefault);
19}
20