all: zero one two three four five six seven eight nine ten \
eleven twelve thirteen fourteen fifteen sixteen seventeen \
- eighteen nineteen twenty
-
+ eighteen nineteen
zero:
#
# llvm : b5.c : Dfoo2
# MachO : main5.c : Dfoo3, Ufoo1
#
- #echo "Five..."
+ #echo "verify that if call to mach-o is optimized away, mach-o func is dead stripped"
${LLVMGCC} ${CCFLAGS} --emit-llvm a5.c -c -o a5.o
${LLVMGCC} ${CCFLAGS} --emit-llvm b5.c -c -o b5.o
${LLVMGCC} ${CCFLAGS} main5.c -c -o main5.o
# llvm : a12.c
# MachO : main12.c
#
- #echo "Tweleve..."
+ #echo "verify tentative def in llvm .o referenced from mach-o"
${LLVMGCC} ${CCFLAGS} --emit-llvm a12.c -c -o a12.o
${LLVMGCC} ${CCFLAGS} main12.c -c -o main12.o
${LLVMGCC} ${CCFLAGS} a12.o main12.o -o main12.exe
${LD} -arch ${ARCH} -r a17.o b17.o -o ab17.o
file ab17.o | grep "Mach-O" | ${PASS_IFF_EMPTY}
# echo "verify ld -r of bitcode and mach-o produces mach-o"
- ${LLVMGCC} ${CCFLAGS} b17.c -c -o b17.o
- ${LD} -arch ${ARCH} -r a17.o b17.o -o ab17.o
- file ab17.o | grep "Mach-O" | ${PASS_IFF_STDIN}
+ ${LLVMGCC} ${CCFLAGS} b17.c -c -o b17m.o
+ ${LD} -arch ${ARCH} -r a17.o b17m.o -o ab17m.o
+ file ab17m.o | grep "Mach-O" | ${PASS_IFF_STDIN}
eighteen:
#echo verify ld -r -keep_private_externs works
${LLVMGCC} ${CCFLAGS} --emit-llvm a18.c -c -o a18.o
${LD} -arch ${ARCH} -r -keep_private_externs a18.o -o a18-rkpe.o
- ObjectDump -nm a18-rkpe.o | grep _common_hidden1 | grep " hidden" | ${FAIL_IF_EMPTY}
- ObjectDump -nm a18-rkpe.o | grep _func_hidden2 | grep " hidden" | ${FAIL_IF_EMPTY}
+ nm -nm a18-rkpe.o | grep _common_hidden1 | grep "private external" | ${FAIL_IF_EMPTY}
+ nm -nm a18-rkpe.o | grep _func_hidden2 | grep "private external" | ${FAIL_IF_EMPTY}
#echo verify ld -r makes hidden symbols internal (except for commons)
${LD} -arch ${ARCH} -r a18.o -o a18-r.o
#ObjectDump -nm a18-r.o | grep _common_hidden1 | grep " hidden" | ${FAIL_IF_EMPTY}
twenty:
#echo verify bitcode files in archives works
- ${LLVMGCC} ${CCFLAGS} --emit-llvm a20.c -c -o a20.o
- ${LLVMGCC} ${CCFLAGS} --emit-llvm b20.c -c -o b20.o
- ar cru lib20.a a20.o b20.o
- ${LLVMGCC} ${CCFLAGS} main20.c lib20.a -all_load -o main20.exe
- nm main20.exe | grep _foo | ${PASS_IFF_STDIN}
-
+ #${LLVMGCC} ${CCFLAGS} --emit-llvm a20.c -c -o a20.o
+ #${LLVMGCC} ${CCFLAGS} --emit-llvm b20.c -c -o b20.o
+ #libtool -static a20.o b20.o -o lib20.a
+ #${LLVMGCC} ${CCFLAGS} main20.c lib20.a -all_load -o main20.exe
+ #nm main20.exe | grep _foo | ${PASS_IFF_STDIN}
+
+
clean:
- rm -rf *.o main*.exe big.* *.dylib main16.exe.lto.bc fail.log lib20.a
+ rm -rf *.o main*.exe big.* *.dylib main16.exe.lto.bc fail.log lib20.a main21.preload lib21.a