2 # Copyright (c) 2007-2008 Apple Inc. All rights reserved.
4 # @APPLE_LICENSE_HEADER_START@
6 # This file contains Original Code and/or Modifications of Original Code
7 # as defined in and that are subject to the Apple Public Source License
8 # Version 2.0 (the 'License'). You may not use this file except in
9 # compliance with the License. Please obtain a copy of the License at
10 # http://www.opensource.apple.com/apsl/ and read it before using this
13 # The Original Code and all software distributed under the License are
14 # distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 # FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 # Please see the License for the specific language governing rights and
19 # limitations under the License.
21 # @APPLE_LICENSE_HEADER_END@
24 include ${TESTROOT}/include/common.makefile
27 # Tests the use of wildcards in exported symbol lists
33 ${CC} ${CCFLAGS} -dynamiclib foo.c -o libfoo.dylib -Wl,-exported_symbol -Wl,'_foo*bar'
34 nm -j -g libfoo.dylib -s __TEXT __text | diff - expect1 | ${FAIL_IF_STDIN}
35 ${FAIL_IF_BAD_MACHO} libfoo.dylib
37 ${CC} ${CCFLAGS} -dynamiclib foo.c -o libfoo.dylib -Wl,-exported_symbol -Wl,'_f?o'
38 nm -j -g libfoo.dylib -s __TEXT __text | diff - expect2 | ${FAIL_IF_STDIN}
39 ${FAIL_IF_BAD_MACHO} libfoo.dylib
41 ${CC} ${CCFLAGS} -dynamiclib foo.c -o libfoo.dylib -Wl,-exported_symbol -Wl,'_foo*'
42 nm -j -g libfoo.dylib -s __TEXT __text | diff - expect3 | ${FAIL_IF_STDIN}
43 ${FAIL_IF_BAD_MACHO} libfoo.dylib
45 ${CC} ${CCFLAGS} -dynamiclib foo.c -o libfoo.dylib -Wl,-exported_symbol -Wl,'_f*o*'
46 nm -j -g libfoo.dylib -s __TEXT __text | diff - expect4 | ${FAIL_IF_STDIN}
47 ${FAIL_IF_BAD_MACHO} libfoo.dylib
49 ${CC} ${CCFLAGS} -dynamiclib foo.c -o libfoo.dylib -Wl,-exported_symbol -Wl,_foo -Wl,-exported_symbol -Wl,'_*bar'
50 nm -j -g libfoo.dylib -s __TEXT __text | diff - expect5 | ${FAIL_IF_STDIN}
51 ${FAIL_IF_BAD_MACHO} libfoo.dylib
53 ${CC} ${CCFLAGS} -dynamiclib foo.c -o libfoo.dylib -exported_symbols_list list5
54 nm -j -g libfoo.dylib -s __TEXT __text | diff - expect5 | ${FAIL_IF_STDIN}
55 ${FAIL_IF_BAD_MACHO} libfoo.dylib
57 ${CC} ${CCFLAGS} -dynamiclib foo.c -o libfoo.dylib -Wl,-unexported_symbol -Wl,'_*2*'
58 nm -j -g libfoo.dylib -s __TEXT __text | diff - expect6 | ${FAIL_IF_STDIN}
59 ${FAIL_IF_BAD_MACHO} libfoo.dylib
61 ${CC} ${CCFLAGS} -dynamiclib foo.c -o libfoo.dylib -Wl,-exported_symbol -Wl,'_f[abcdef]o'
62 nm -j -g libfoo.dylib -s __TEXT __text | diff - expect7 | ${FAIL_IF_STDIN}
63 ${FAIL_IF_BAD_MACHO} libfoo.dylib
65 ${CC} ${CCFLAGS} -dynamiclib foo.c -o libfoo.dylib -Wl,-exported_symbol -Wl,'_f[a-f]o'
66 nm -j -g libfoo.dylib -s __TEXT __text | diff - expect7 | ${FAIL_IF_STDIN}
67 ${FAIL_IF_BAD_MACHO} libfoo.dylib
69 ${CC} ${CCFLAGS} -dynamiclib foo.c -o libfoo.dylib -Wl,-exported_symbol -Wl,'_f[a-z]o'
70 nm -j -g libfoo.dylib -s __TEXT __text | diff - expect8 | ${FAIL_IF_STDIN}
71 ${FAIL_IF_BAD_MACHO} libfoo.dylib
73 ${CC} ${CCFLAGS} -dynamiclib foo.c -o libfoo.dylib -Wl,-exported_symbol -Wl,'_f[a-fnop]o'
74 nm -j -g libfoo.dylib -s __TEXT __text | diff - expect8 | ${FAIL_IF_STDIN}
75 ${PASS_IFF_GOOD_MACHO} libfoo.dylib