]> git.saurik.com Git - apple/objc4.git/blob - test/imports.c
objc4-756.2.tar.gz
[apple/objc4.git] / test / imports.c
1 /*
2 Disallow some imports into and exports from libobjc.A.dylib.
3
4 To debug, re-run libobjc's link command with
5 -Xlinker -dead_strip -Xlinker -why_live -Xlinker SYMBOL_NAME_HERE
6
7 Disallowed imports (nm -u):
8 ___cxa_guard_acquire (C++ function-scope static initializer)
9 ___cxa_guard_release (C++ function-scope static initializer)
10 ___cxa_atexit (C++ static destructor)
11 weak external (any weak externals, including operators new and delete)
12
13 Disallowed exports (nm -U):
14 __Z* (any C++-mangled export)
15 weak external (any weak externals, including operators new and delete)
16
17 fixme rdar://13354718 should disallow anything from libc++ (i.e. not libc++abi)
18 */
19
20 /*
21 TEST_BUILD
22 echo $C{XCRUN} nm -m -arch $C{ARCH} $C{TESTLIB}
23 $C{XCRUN} nm -u -m -arch $C{ARCH} $C{TESTLIB} | egrep '(weak external| external (___cxa_atexit|___cxa_guard_acquire|___cxa_guard_release))' || true
24 $C{XCRUN} nm -U -m -arch $C{ARCH} $C{TESTLIB} | egrep '(weak external| external __Z)' || true
25 $C{COMPILE_C} $DIR/imports.c -o imports.exe
26 END
27
28 TEST_BUILD_OUTPUT
29 .*libobjc.A.dylib
30 END
31 */
32
33 #include "test.h"
34 int main()
35 {
36 succeed(__FILE__);
37 }