#!/bin/bash set -e cd $(dirname $0) mold=`pwd`/../mold echo -n "Testing $(basename -s .sh $0) ... " t=$(pwd)/tmp/$(basename -s .sh $0) mkdir -p $t truncate -s 15 $t/a.bin cat < int three(); int main() { printf("%d\n", three()); } EOF rm -f $t/d.a ar rcs $t/d.a $t/a.bin $t/b.o clang -fuse-ld=$mold -o $t/exe $t/c.o $t/d.a echo OK