]> git.saurik.com Git - apple/ld64.git/blame - unit-tests/test-cases/objc-gc-checks/Makefile
ld64-77.tar.gz
[apple/ld64.git] / unit-tests / test-cases / objc-gc-checks / Makefile
CommitLineData
a61fdf0a
A
1##
2# Copyright (c) 2007 Apple Inc. All rights reserved.
3#
4# @APPLE_LICENSE_HEADER_START@
5#
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
11# file.
12#
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.
20#
21# @APPLE_LICENSE_HEADER_END@
22##
23TESTROOT = ../..
24include ${TESTROOT}/include/common.makefile
25
26SHELL = bash # use bash shell so we can redirect just stderr
27
28#
29# Validate that the linker catches illegal combinations of .o files
30# compiled with different GC settings.
31#
32
33test:
34 ${CC} ${CCFLAGS} foo.m -c -o foo.o
35 ${FAIL_IF_BAD_OBJ} foo.o
36
37 ${CC} ${CCFLAGS} foo.m -c -o foo-gc.o -fobjc-gc
38 ${FAIL_IF_BAD_OBJ} foo-gc.o
39
40 ${CC} ${CCFLAGS} foo.m -c -o foo-gc-only.o -fobjc-gc-only
41 ${FAIL_IF_BAD_OBJ} foo-gc-only.o
42
43 ${CC} ${CCFLAGS} bar.m -c -o bar.o
44 ${FAIL_IF_BAD_OBJ} bar.o
45
46 ${CC} ${CCFLAGS} bar.m -c -o bar-gc.o -fobjc-gc
47 ${FAIL_IF_BAD_OBJ} bar-gc.o
48
49 ${CC} ${CCFLAGS} bar.m -c -o bar-gc-only.o -fobjc-gc-only
50 ${FAIL_IF_BAD_OBJ} bar-gc-only.o
51
52 # check RR + RR -> RR
53 ${CC} foo.o bar.o -dynamiclib -o libfoobar.dylib -framework Foundation
54 ${FAIL_IF_BAD_MACHO} libfoobar.dylib
55
56 # check GC/RR + GC/RR -> GC/RR
57 ${CC} foo-gc.o bar-gc.o -dynamiclib -o libfoobar.dylib -framework Foundation
58 ${FAIL_IF_BAD_MACHO} libfoobar.dylib
59
60 # check GC + GC -> GC
61 ${CC} foo-gc-only.o bar-gc-only.o -dynamiclib -o libfoobar.dylib -framework Foundation
62 ${FAIL_IF_BAD_MACHO} libfoobar.dylib
63
64 # check RR + GC/RR -> error
65 ${FAIL_IF_SUCCESS} ${CC} foo.o bar-gc.o -dynamiclib -o libfoobar.dylib -framework Foundation 2> fail.log
66
67 # check RR + GC -> error
68 ${FAIL_IF_SUCCESS} ${CC} foo.o bar-gc-only.o -dynamiclib -o libfoobar.dylib -framework Foundation 2> fail.log
69
70 # check GC + GC/RR -> error
71 ${FAIL_IF_SUCCESS} ${CC} foo-gc-only.o bar-gc.o -dynamiclib -o libfoobar.dylib -framework Foundation 2> fail.log
72 ${PASS_IFF} true
73
74clean:
75 rm -rf foo*.o bar*.o libfoobar.dylib fail.log