From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/SemaObjC/builtin_objc_lib_functions.m | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 clang/test/SemaObjC/builtin_objc_lib_functions.m (limited to 'clang/test/SemaObjC/builtin_objc_lib_functions.m') diff --git a/clang/test/SemaObjC/builtin_objc_lib_functions.m b/clang/test/SemaObjC/builtin_objc_lib_functions.m new file mode 100644 index 0000000..956ee12 --- /dev/null +++ b/clang/test/SemaObjC/builtin_objc_lib_functions.m @@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -x objective-c %s -fsyntax-only -verify +// rdar://8592641 +Class f0() { return objc_getClass("a"); } // expected-warning {{implicitly declaring library function 'objc_getClass' with type 'id (const char *)'}} \ + // expected-note {{please include the header or explicitly provide a declaration for 'objc_getClass'}} + +// rdar://8735023 +Class f1() { return objc_getMetaClass("a"); } // expected-warning {{implicitly declaring library function 'objc_getMetaClass' with type 'id (const char *)'}} \ + // expected-note {{please include the header or explicitly provide a declaration for 'objc_getMetaClass'}} + +void f2(id val) { objc_enumerationMutation(val); } // expected-warning {{implicitly declaring library function 'objc_enumerationMutation' with type 'void (id)'}} \ + // expected-note {{please include the header or explicitly provide a declaration for 'objc_enumerationMutation'}} + +long 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, ...)'}} \ + // expected-note {{please include the header or explicitly provide a declaration for 'objc_msgSend_fpret'}} + +id f4(struct objc_super *super, SEL op) { // expected-warning {{declaration of 'struct objc_super' will not be visible outside of this function}} + return objc_msgSendSuper(super, op); // expected-warning {{implicitly declaring library function 'objc_msgSendSuper' with type 'id (void *, SEL, ...)'}} \ + // expected-note {{please include the header or explicitly provide a declaration for 'objc_msgSendSuper'}} +} + +id f5(id val, id *dest) { + return objc_assign_strongCast(val, dest); // expected-warning {{implicitly declaring library function 'objc_assign_strongCast' with type 'id (id, id *)'}} \ + // expected-note {{please include the header or explicitly provide a declaration for 'objc_assign_strongCast'}} +} + +int f6(Class exceptionClass, id exception) { + return objc_exception_match(exceptionClass, exception); // expected-warning {{implicitly declaring library function 'objc_exception_match' with type 'int (id, id)'}} \ + // expected-note {{please include the header or explicitly provide a declaration for 'objc_exception_match'}} +} -- cgit v1.2.3