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
45 clang foo.c -arch armv4t -c -o foo-v4.o
46 ${FAIL_IF_BAD_OBJ} foo-v4.o
47 clang foo.c -arch armv5 -c -o foo-v5.o
48 ${FAIL_IF_BAD_OBJ} foo-v5.o
49 clang foo.c -arch armv6 -c -o foo-v6.o
50 ${FAIL_IF_BAD_OBJ} foo-v6.o
51 clang foo.c -arch armv7 -c -o foo-v7.o
52 ${FAIL_IF_BAD_OBJ} foo-v7.o
53 clang foo.c -arch xscale -c -o foo-xscale.o
54 ${FAIL_IF_BAD_OBJ} foo-xscale.o
55 clang main.c -arch armv4t -c -o main-v4.o
56 ${FAIL_IF_BAD_OBJ} main-v4.o
57 clang main.c -arch armv5 -c -o main-v5.o
58 ${FAIL_IF_BAD_OBJ} main-v5.o
59 clang main.c -arch armv6 -c -o main-v6.o
60 ${FAIL_IF_BAD_OBJ} main-v6.o
61 clang main.c -arch xscale -c -o main-xscale.o
62 ${FAIL_IF_BAD_OBJ} main-xscale.o
63 clang main.c -arch armv7 -c -o main-v7.o
64 ${FAIL_IF_BAD_OBJ} main-v7.o
67 ${LD} -r main-v4.o foo-v4.o -o all.o
68 ${FAIL_IF_BAD_OBJ} all.o
69 otool -hv all.o | grep V4T | ${FAIL_IF_EMPTY}
72 #${LD} -r main-v4.o foo-v5.o -o all.o
73 #${FAIL_IF_BAD_OBJ} all.o
74 #otool -hv all.o | grep V5 | ${FAIL_IF_EMPTY}
77 #${LD} -r main-v4.o foo-v6.o -o all.o
78 #${FAIL_IF_BAD_OBJ} all.o
79 #otool -hv all.o | grep V6 | ${FAIL_IF_EMPTY}
81 # check V4+xscale -> xscale
82 #${LD} -r main-v4.o foo-xscale.o -o all.o
83 #${FAIL_IF_BAD_OBJ} all.o
84 #otool -hv all.o | grep XSCALE | ${FAIL_IF_EMPTY}
87 ${LD} -r main-v5.o foo-v5.o -o all.o
88 ${FAIL_IF_BAD_OBJ} all.o
89 otool -hv all.o | grep V5 | ${FAIL_IF_EMPTY}
92 #${LD} -r main-v5.o foo-v6.o -o all.o
93 #${FAIL_IF_BAD_OBJ} all.o
94 #otool -hv all.o | grep V6 | ${FAIL_IF_EMPTY}
96 # check V5+xscale -> xscale
97 #${LD} -r main-v5.o foo-xscale.o -o all.o
98 #${FAIL_IF_BAD_OBJ} all.o
99 #otool -hv all.o | grep XSCALE | ${FAIL_IF_EMPTY}
102 ${LD} -r main-v6.o foo-v6.o -o all.o
103 ${FAIL_IF_BAD_OBJ} all.o
104 otool -hv all.o | grep V6 | ${FAIL_IF_EMPTY}
107 ${LD} -r main-v7.o foo-v7.o -o all.o
108 ${FAIL_IF_BAD_OBJ} all.o
109 otool -hv all.o | grep V7 | ${FAIL_IF_EMPTY}
111 # check xscale+xscale -> xscale
112 #${LD} -r main-xscale.o foo-xscale.o -o all.o
113 #${FAIL_IF_BAD_OBJ} all.o
114 #otool -hv all.o | grep XSCALE | ${FAIL_IF_EMPTY}
120 gcc foo.c -arch ppc -mmacosx-version-min=10.4 -c -o foo.o
121 ${FAIL_IF_BAD_OBJ} foo.o
122 gcc foo.c -arch ppc750 -c -o foo-G3.o
123 ${FAIL_IF_BAD_OBJ} foo-G3.o
124 gcc foo.c -arch ppc7400 -c -o foo-G4.o
125 ${FAIL_IF_BAD_OBJ} foo-G4.o
126 gcc foo.c -arch ppc970 -c -o foo-G5.o
127 ${FAIL_IF_BAD_OBJ} foo-G5.o
128 gcc main.c -arch ppc -mmacosx-version-min=10.4 -c -o main.o
129 ${FAIL_IF_BAD_OBJ} main.o
130 gcc main.c -arch ppc970 -c -o main-G5.o
131 ${FAIL_IF_BAD_OBJ} main-G5.o
133 # check ALL+ALL -> ALL
134 ${LD} -r main.o foo.o -o main-r.o
135 ${FAIL_IF_BAD_OBJ} main-r.o
136 otool -hv main-r.o | grep ALL | ${FAIL_IF_EMPTY}
139 ${LD} -r main.o foo-G3.o -o main-r.o
140 ${FAIL_IF_BAD_OBJ} main-r.o
141 otool -hv main-r.o | grep ppc750 | ${FAIL_IF_EMPTY}
144 ${LD} -r main.o foo-G4.o -o main-r.o
145 ${FAIL_IF_BAD_OBJ} main-r.o
146 otool -hv main-r.o | grep ppc7400 | ${FAIL_IF_EMPTY}
149 ${LD} -r main.o foo-G5.o -o main-r.o
150 ${FAIL_IF_BAD_OBJ} main-r.o
151 otool -hv main-r.o | grep ppc970 | ${FAIL_IF_EMPTY}
154 ${LD} -r main-G5.o foo-G4.o -o main-r.o
155 ${FAIL_IF_BAD_OBJ} main-r.o
156 otool -hv main-r.o | grep ppc970 | ${FAIL_IF_EMPTY}
159 ${LD} -r foo-G4.o main-G5.o -o main-r.o
160 ${FAIL_IF_BAD_OBJ} main-r.o
161 otool -hv main-r.o | grep ppc970 | ${FAIL_IF_EMPTY}
163 # check -force_cpusubtype_ALL
164 ${LD} -r main.o foo-G5.o -o main-r.o -force_cpusubtype_ALL
165 ${FAIL_IF_BAD_OBJ} main-r.o
166 otool -hv main-r.o | grep ALL | ${PASS_IFF_STDIN}