1 // RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -verify -fblocks -triple x86_64-apple-darwin10.0.0 %s
2 // RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -verify -fblocks -triple x86_64-apple-darwin10.0.0 %s
8 void *memset(void *, int, __SIZE_TYPE__);
9 void *memmove(void *s1, const void *s2, __SIZE_TYPE__ n);
10 void *memcpy(void *s1, const void *s2, __SIZE_TYPE__ n);
16 void test(id __strong *sip, id __weak *wip, id __autoreleasing *aip,
17 id __unsafe_unretained *uip, void *ptr) {
24 memcpy(sip, ptr, 17); // expected-warning{{destination for this 'memcpy' call is a pointer to ownership-qualified type}} \
25 // expected-note{{explicitly cast the pointer to silence this warning}}
26 memcpy(wip, ptr, 17); // expected-warning{{destination for this 'memcpy' call is a pointer to ownership-qualified type}} \
27 // expected-note{{explicitly cast the pointer to silence this warning}}
28 memcpy(aip, ptr, 17); // expected-warning{{destination for this 'memcpy' call is a pointer to ownership-qualified type}} \
29 // expected-note{{explicitly cast the pointer to silence this warning}}
32 memcpy(ptr, sip, 17); // expected-warning{{source of this 'memcpy' call is a pointer to ownership-qualified type}} \
33 // expected-note{{explicitly cast the pointer to silence this warning}}
34 memcpy(ptr, wip, 17); // expected-warning{{source of this 'memcpy' call is a pointer to ownership-qualified type}} \
35 // expected-note{{explicitly cast the pointer to silence this warning}}
36 memcpy(ptr, aip, 17); // expected-warning{{source of this 'memcpy' call is a pointer to ownership-qualified type}} \
37 // expected-note{{explicitly cast the pointer to silence this warning}}
40 memmove(sip, ptr, 17); // expected-warning{{destination for this 'memmove' call is a pointer to ownership-qualified type}} \
41 // expected-note{{explicitly cast the pointer to silence this warning}}
42 memmove(wip, ptr, 17); // expected-warning{{destination for this 'memmove' call is a pointer to ownership-qualified type}} \
43 // expected-note{{explicitly cast the pointer to silence this warning}}
44 memmove(aip, ptr, 17); // expected-warning{{destination for this 'memmove' call is a pointer to ownership-qualified type}} \
45 // expected-note{{explicitly cast the pointer to silence this warning}}
46 memmove(uip, ptr, 17);
48 memmove(ptr, sip, 17); // expected-warning{{source of this 'memmove' call is a pointer to ownership-qualified type}} \
49 // expected-note{{explicitly cast the pointer to silence this warning}}
50 memmove(ptr, wip, 17); // expected-warning{{source of this 'memmove' call is a pointer to ownership-qualified type}} \
51 // expected-note{{explicitly cast the pointer to silence this warning}}
52 memmove(ptr, aip, 17); // expected-warning{{source of this 'memmove' call is a pointer to ownership-qualified type}} \
53 // expected-note{{explicitly cast the pointer to silence this warning}}
54 memmove(ptr, uip, 17);
57 void rdar9772982(int i, ...) {
60 __builtin_va_start(ap, i);
61 __builtin_va_arg(ap, __strong id); // expected-error{{second argument to 'va_arg' is of ARC ownership-qualified type '__strong id'}}