2 # Copyright (c) 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 # Validate cpu subtype preference
45 clang foo.c -arch armv4t -c -DAAA=1 -o foo4.o
46 clang foo.c -arch armv5 -c -DBBB=1 -o foo5.o
47 clang foo.c -arch armv6 -c -DCCC=1 -o foo6.o
48 clang foo.c -arch armv7 -c -DDDD=1 -o foo7.o
49 lipo foo4.o foo5.o foo6.o foo7.o -create -output foo.o
51 # check -arch armv4t pulls out V4 slice
52 ${LD} -r -arch armv4t foo.o -o fooa.o
53 otool -hv fooa.o | grep V4T | ${FAIL_IF_EMPTY}
54 nm fooa.o | grep _aaa | ${FAIL_IF_EMPTY}
56 # check -arch armv5 pulls out V5 slice
57 ${LD} -r -arch armv5 foo.o -o foob.o
58 otool -hv foob.o | grep V5 | ${FAIL_IF_EMPTY}
59 nm foob.o | grep _bbb | ${FAIL_IF_EMPTY}
61 # check -arch armv6 pulls out V6 slice
62 ${LD} -r -arch armv6 foo.o -o fooc.o
63 otool -hv fooc.o | grep V6 | ${FAIL_IF_EMPTY}
64 nm fooc.o | grep _ccc | ${FAIL_IF_EMPTY}
66 # check -arch armv7 pulls out V7 slice
67 ${LD} -r -arch armv7 foo.o -o fooc.o
68 otool -hv fooc.o | grep V7 | ${FAIL_IF_EMPTY}
69 nm fooc.o | grep _ddd | ${FAIL_IF_EMPTY}
75 gcc foo.c -arch ppc750 -c -DAAA=1 -o foog3.o
76 gcc foo.c -arch ppc7400 -c -DBBB=1 -o foog4.o
77 gcc foo.c -arch ppc970 -c -DCCC=1 -o foog5.o
78 lipo foog3.o foog4.o foog5.o -create -output foo.o
80 # check -arch ppc750 pulls out g3 slice
81 ${LD} -r -arch ppc750 foo.o -o fooa.o
82 otool -hv fooa.o | grep ppc750 | ${FAIL_IF_EMPTY}
83 nm fooa.o | grep _aaa | ${FAIL_IF_EMPTY}
85 # check -arch ppc7400 pulls out g4 slice
86 ${LD} -r -arch ppc7400 foo.o -o foob.o
87 otool -hv foob.o | grep ppc7400 | ${FAIL_IF_EMPTY}
88 nm foob.o | grep _bbb | ${FAIL_IF_EMPTY}
90 # check -arch ppc970 pulls out g5 slice
91 ${LD} -r -arch ppc970 foo.o -o fooc.o
92 otool -hv fooc.o | grep ppc970 | ${FAIL_IF_EMPTY}
93 nm fooc.o | grep _ccc | ${FAIL_IF_EMPTY}