blob: d8713ddfb416e3abdb633168137de1a2a9703e4d [file] [log] [blame]
Fariborz Jahanianaae79262010-12-10 00:39:16 +00001// RUN: %clang_cc1 -x objective-c %s -fsyntax-only -verify
2// rdar://8592641
Jean-Daniel Dupas400dd1c2012-01-27 23:21:02 +00003Class f0() { return objc_getClass("a"); } // expected-warning {{implicitly declaring library function 'objc_getClass' with type 'id (const char *)'}} \
Fariborz Jahanianaae79262010-12-10 00:39:16 +00004 // expected-note {{please include the header <objc/runtime.h> or explicitly provide a declaration for 'objc_getClass'}}
5
6// rdar://8735023
Jean-Daniel Dupas400dd1c2012-01-27 23:21:02 +00007Class f1() { return objc_getMetaClass("a"); } // expected-warning {{implicitly declaring library function 'objc_getMetaClass' with type 'id (const char *)'}} \
Fariborz Jahanianaae79262010-12-10 00:39:16 +00008 // expected-note {{please include the header <objc/runtime.h> or explicitly provide a declaration for 'objc_getMetaClass'}}
9
Jean-Daniel Dupas400dd1c2012-01-27 23:21:02 +000010void f2(id val) { objc_enumerationMutation(val); } // expected-warning {{implicitly declaring library function 'objc_enumerationMutation' with type 'void (id)'}} \
Fariborz Jahanianaae79262010-12-10 00:39:16 +000011 // expected-note {{please include the header <objc/runtime.h> or explicitly provide a declaration for 'objc_enumerationMutation'}}
12
Jean-Daniel Dupas400dd1c2012-01-27 23:21:02 +000013long double f3(id self, SEL op) { return objc_msgSend_fpret(self, op); } // expected-warning {{implicitly declaring library function 'objc_msgSend_fpret' with type 'long double (id, SEL, ...)'}} \
Fariborz Jahanianaae79262010-12-10 00:39:16 +000014 // expected-note {{please include the header <objc/message.h> or explicitly provide a declaration for 'objc_msgSend_fpret'}}
15
16id f4(struct objc_super *super, SEL op) { // expected-warning {{declaration of 'struct objc_super' will not be visible outside of this function}}
Fariborz Jahaniancb6c8672013-01-04 18:45:40 +000017 return objc_msgSendSuper(super, op); // expected-warning {{implicitly declaring library function 'objc_msgSendSuper' with type 'id (struct objc_super *, SEL, ...)'}} \
Fariborz Jahanianaae79262010-12-10 00:39:16 +000018 // expected-note {{please include the header <objc/message.h> or explicitly provide a declaration for 'objc_msgSendSuper'}}
19}
20
21id f5(id val, id *dest) {
Jean-Daniel Dupas400dd1c2012-01-27 23:21:02 +000022 return objc_assign_strongCast(val, dest); // expected-warning {{implicitly declaring library function 'objc_assign_strongCast' with type 'id (id, id *)'}} \
Jean-Daniel Dupas5778cb82012-01-24 22:29:27 +000023 // expected-note {{please include the header <objc/objc-auto.h> or explicitly provide a declaration for 'objc_assign_strongCast'}}
Fariborz Jahanianaae79262010-12-10 00:39:16 +000024}
25
26int f6(Class exceptionClass, id exception) {
Jean-Daniel Dupas400dd1c2012-01-27 23:21:02 +000027 return objc_exception_match(exceptionClass, exception); // expected-warning {{implicitly declaring library function 'objc_exception_match' with type 'int (id, id)'}} \
Jean-Daniel Dupas5778cb82012-01-24 22:29:27 +000028 // expected-note {{please include the header <objc/objc-exception.h> or explicitly provide a declaration for 'objc_exception_match'}}
Fariborz Jahanianaae79262010-12-10 00:39:16 +000029}