]> git.saurik.com Git - apple/ld64.git/blame - unit-tests/test-cases/cpu-sub-types-preference/Makefile
ld64-127.2.tar.gz
[apple/ld64.git] / unit-tests / test-cases / cpu-sub-types-preference / Makefile
CommitLineData
2f2f92e4
A
1##
2# Copyright (c) 2008 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
26#
27# Validate cpu subtype preference
28#
29
30test: test-${ARCH}
31
32test-ppc64:
33 ${PASS_IFF} true
34
35test-i386:
36 ${PASS_IFF} true
37
38test-x86_64:
39 ${PASS_IFF} true
40
afe874b1
A
41test-armv6: test-arm
42test-armv7: test-arm
43
44test-arm:
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
2f2f92e4
A
50
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}
55
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}
60
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}
65
afe874b1
A
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}
2f2f92e4
A
70
71 ${PASS_IFF} true
72
73
74test-ppc:
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
79
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}
84
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}
89
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}
94
95 ${PASS_IFF} true
96
97
98clean:
99 rm -f *.o