##
-# Copyright (c) 2010 Apple Inc. All rights reserved.
+# Copyright (c) 2010-2011 Apple Inc. All rights reserved.
#
# @APPLE_LICENSE_HEADER_START@
#
TESTROOT = ../..
include ${TESTROOT}/include/common.makefile
+SHELL = bash # use bash shell so we can redirect just stderr
+
#
# <rdar://problem/7438246> LTO with 'dead code strip' can't ignore unused functions with undefined references
+# <rdar://problem/10052396> LTO many have eliminated need for some undefines
#
-LLVMGCC = /Developer/usr/bin/llvm-gcc-4.2 -arch ${ARCH}
-LLVMGXX = /Developer/usr/bin/llvm-g++-4.2 -arch ${ARCH}
-
run: all
all:
- ${LLVMGCC} ${CCFLAGS} --emit-llvm bar.c -c -o bar.o
- ${LLVMGCC} ${CCFLAGS} --emit-llvm main.c -c -o main.o
- ${LLVMGCC} ${CCFLAGS} -dead_strip main.o bar.o -o main
+ ${CC} ${CCFLAGS} -flto bar.c -c -o bar.o
+ ${CC} ${CCFLAGS} -flto main.c -c -o main.o
+ ${CC} ${CCFLAGS} main.o bar.o -o main
+ ${CC} ${CCFLAGS} main.o bar.o -o main -dead_strip
+ ${CC} ${CCFLAGS} main.o bar.o -dynamiclib -o libmain.dylib -Wl,-exported_symbol,_main
+ ${FAIL_IF_SUCCESS} ${CC} ${CCFLAGS} main.o bar.o -dynamiclib -o libmain.dylib -dead_strip 2>/dev/null
${PASS_IFF_GOOD_MACHO} main
clean: