2 # Copyright (c) 2007 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 # Validate cpu subtypes processing
42 gcc foo.c -arch armv4t -c -o foo-v4.o
43 ${FAIL_IF_BAD_OBJ} foo-v4.o
44 gcc foo.c -arch armv5 -c -o foo-v5.o
45 ${FAIL_IF_BAD_OBJ} foo-v5.o
46 gcc foo.c -arch armv6 -c -o foo-v6.o
47 ${FAIL_IF_BAD_OBJ} foo-v6.o
48 gcc foo.c -arch xscale -c -o foo-xscale.o
49 ${FAIL_IF_BAD_OBJ} foo-xscale.o
50 gcc main.c -arch armv4t -c -o main-v4.o
51 ${FAIL_IF_BAD_OBJ} main-v4.o
52 gcc main.c -arch armv5 -c -o main-v5.o
53 ${FAIL_IF_BAD_OBJ} main-v5.o
54 gcc main.c -arch armv6 -c -o main-v6.o
55 ${FAIL_IF_BAD_OBJ} main-v6.o
56 gcc main.c -arch xscale -c -o main-xscale.o
57 ${FAIL_IF_BAD_OBJ} main-xscale.o
60 ${LD} -r main-v4.o foo-v4.o -o all.o
61 ${FAIL_IF_BAD_OBJ} all.o
62 otool -hv all.o | grep V4T | ${FAIL_IF_EMPTY}
65 ${LD} -r main-v4.o foo-v5.o -o all.o
66 ${FAIL_IF_BAD_OBJ} all.o
67 otool -hv all.o | grep V5 | ${FAIL_IF_EMPTY}
70 ${LD} -r main-v4.o foo-v6.o -o all.o
71 ${FAIL_IF_BAD_OBJ} all.o
72 otool -hv all.o | grep V6 | ${FAIL_IF_EMPTY}
74 # check V4+xscale -> xscale
75 ${LD} -r main-v4.o foo-xscale.o -o all.o
76 ${FAIL_IF_BAD_OBJ} all.o
77 otool -hv all.o | grep XSCALE | ${FAIL_IF_EMPTY}
80 ${LD} -r main-v5.o foo-v5.o -o all.o
81 ${FAIL_IF_BAD_OBJ} all.o
82 otool -hv all.o | grep V5 | ${FAIL_IF_EMPTY}
85 ${LD} -r main-v5.o foo-v6.o -o all.o
86 ${FAIL_IF_BAD_OBJ} all.o
87 otool -hv all.o | grep V6 | ${FAIL_IF_EMPTY}
89 # check V5+xscale -> xscale
90 ${LD} -r main-v5.o foo-xscale.o -o all.o
91 ${FAIL_IF_BAD_OBJ} all.o
92 otool -hv all.o | grep XSCALE | ${FAIL_IF_EMPTY}
95 ${LD} -r main-v6.o foo-v6.o -o all.o
96 ${FAIL_IF_BAD_OBJ} all.o
97 otool -hv all.o | grep V6 | ${FAIL_IF_EMPTY}
99 # check xscale+xscale -> xscale
100 ${LD} -r main-xscale.o foo-xscale.o -o all.o
101 ${FAIL_IF_BAD_OBJ} all.o
102 otool -hv all.o | grep XSCALE | ${FAIL_IF_EMPTY}
108 gcc foo.c -arch ppc -mmacosx-version-min=10.4 -c -o foo.o
109 ${FAIL_IF_BAD_OBJ} foo.o
110 gcc foo.c -arch ppc750 -c -o foo-G3.o
111 ${FAIL_IF_BAD_OBJ} foo-G3.o
112 gcc foo.c -arch ppc7400 -c -o foo-G4.o
113 ${FAIL_IF_BAD_OBJ} foo-G4.o
114 gcc foo.c -arch ppc970 -c -o foo-G5.o
115 ${FAIL_IF_BAD_OBJ} foo-G5.o
116 gcc main.c -arch ppc -mmacosx-version-min=10.4 -c -o main.o
117 ${FAIL_IF_BAD_OBJ} main.o
118 gcc main.c -arch ppc970 -c -o main-G5.o
119 ${FAIL_IF_BAD_OBJ} main-G5.o
121 # check ALL+ALL -> ALL
122 ${LD} -r main.o foo.o -o main-r.o
123 ${FAIL_IF_BAD_OBJ} main-r.o
124 otool -hv main-r.o | grep ALL | ${FAIL_IF_EMPTY}
127 ${LD} -r main.o foo-G3.o -o main-r.o
128 ${FAIL_IF_BAD_OBJ} main-r.o
129 otool -hv main-r.o | grep ppc750 | ${FAIL_IF_EMPTY}
132 ${LD} -r main.o foo-G4.o -o main-r.o
133 ${FAIL_IF_BAD_OBJ} main-r.o
134 otool -hv main-r.o | grep ppc7400 | ${FAIL_IF_EMPTY}
137 ${LD} -r main.o foo-G5.o -o main-r.o
138 ${FAIL_IF_BAD_OBJ} main-r.o
139 otool -hv main-r.o | grep ppc970 | ${FAIL_IF_EMPTY}
142 ${LD} -r main-G5.o foo-G4.o -o main-r.o
143 ${FAIL_IF_BAD_OBJ} main-r.o
144 otool -hv main-r.o | grep ppc970 | ${FAIL_IF_EMPTY}
147 ${LD} -r foo-G4.o main-G5.o -o main-r.o
148 ${FAIL_IF_BAD_OBJ} main-r.o
149 otool -hv main-r.o | grep ppc970 | ${FAIL_IF_EMPTY}
151 # check -force_cpusubtype_ALL
152 ${LD} -r main.o foo-G5.o -o main-r.o -force_cpusubtype_ALL
153 ${FAIL_IF_BAD_OBJ} main-r.o
154 otool -hv main-r.o | grep ALL | ${PASS_IFF_STDIN}