1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime-has-weak -x objective-c -fobjc-arc -verify %s
3 void *memset(void *, int, __SIZE_TYPE__);
4 void bzero(void *, __SIZE_TYPE__);
5 void *memcpy(void *, const void *, __SIZE_TYPE__);
6 void *memmove(void *, const void *, __SIZE_TYPE__);
15 __weak id f1; // expected-note 2 {{non-trivial to default-initialize}} expected-note 2 {{non-trivial to copy}}
17 id f3[10]; // expected-note 2 {{non-trivial to default-initialize}} expected-note 2 {{non-trivial to copy}}
21 id f0; // expected-note 2 {{non-trivial to default-initialize}} expected-note 2 {{non-trivial to copy}}
23 struct NonTrivial0 f2;
26 void testTrivial(struct Trivial *d, struct Trivial *s) {
27 memset(d, 0, sizeof(struct Trivial));
28 bzero(d, sizeof(struct Trivial));
29 memcpy(d, s, sizeof(struct Trivial));
30 memmove(d, s, sizeof(struct Trivial));
33 void testNonTrivial1(struct NonTrivial1 *d, struct NonTrivial1 *s) {
34 memset(d, 0, sizeof(struct NonTrivial1)); // expected-warning {{that is not trivial to primitive-default-initialize}} expected-note {{explicitly cast the pointer to silence}}
35 memset((void *)d, 0, sizeof(struct NonTrivial1));
36 bzero(d, sizeof(struct NonTrivial1)); // expected-warning {{that is not trivial to primitive-default-initialize}} expected-note {{explicitly cast the pointer to silence}}
37 memcpy(d, s, sizeof(struct NonTrivial1)); // expected-warning {{that is not trivial to primitive-copy}} expected-note {{explicitly cast the pointer to silence}}
38 memmove(d, s, sizeof(struct NonTrivial1)); // expected-warning {{that is not trivial to primitive-copy}} expected-note {{explicitly cast the pointer to silence}}