annotate clang/test/SemaObjC/builtin_objc_lib_functions.m @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -x objective-c %s -fsyntax-only -verify
anatofuz
parents:
diff changeset
2 // rdar://8592641
anatofuz
parents:
diff changeset
3 Class f0() { return objc_getClass("a"); } // expected-warning {{implicitly declaring library function 'objc_getClass' with type 'id (const char *)'}} \
anatofuz
parents:
diff changeset
4 // expected-note {{include the header <objc/runtime.h> or explicitly provide a declaration for 'objc_getClass'}}
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 // rdar://8735023
anatofuz
parents:
diff changeset
7 Class f1() { return objc_getMetaClass("a"); } // expected-warning {{implicitly declaring library function 'objc_getMetaClass' with type 'id (const char *)'}} \
anatofuz
parents:
diff changeset
8 // expected-note {{include the header <objc/runtime.h> or explicitly provide a declaration for 'objc_getMetaClass'}}
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 void f2(id val) { objc_enumerationMutation(val); } // expected-warning {{implicitly declaring library function 'objc_enumerationMutation' with type 'void (id)'}} \
anatofuz
parents:
diff changeset
11 // expected-note {{include the header <objc/runtime.h> or explicitly provide a declaration for 'objc_enumerationMutation'}}
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 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, ...)'}} \
anatofuz
parents:
diff changeset
14 // expected-note {{include the header <objc/message.h> or explicitly provide a declaration for 'objc_msgSend_fpret'}}
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 id f4(struct objc_super *super, SEL op) { // expected-warning {{declaration of 'struct objc_super' will not be visible outside of this function}}
anatofuz
parents:
diff changeset
17 return objc_msgSendSuper(super, op); // expected-warning {{implicitly declaring library function 'objc_msgSendSuper' with type 'id (struct objc_super *, SEL, ...)'}} \
anatofuz
parents:
diff changeset
18 // expected-note {{include the header <objc/message.h> or explicitly provide a declaration for 'objc_msgSendSuper'}}
anatofuz
parents:
diff changeset
19 }
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 id f5(id val, id *dest) {
anatofuz
parents:
diff changeset
22 return objc_assign_strongCast(val, dest); // expected-warning {{implicitly declaring library function 'objc_assign_strongCast' with type 'id (id, id *)'}} \
anatofuz
parents:
diff changeset
23 // expected-note {{include the header <objc/objc-auto.h> or explicitly provide a declaration for 'objc_assign_strongCast'}}
anatofuz
parents:
diff changeset
24 }
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 int f6(Class exceptionClass, id exception) {
anatofuz
parents:
diff changeset
27 return objc_exception_match(exceptionClass, exception); // expected-warning {{implicitly declaring library function 'objc_exception_match' with type 'int (id, id)'}} \
anatofuz
parents:
diff changeset
28 // expected-note {{include the header <objc/objc-exception.h> or explicitly provide a declaration for 'objc_exception_match'}}
anatofuz
parents:
diff changeset
29 }