#!/bin/bash set -e cd $(dirname $0) echo -n "Testing $(basename -s .sh $0) ... " t=$(pwd)/tmp/$(basename -s .sh $0) mkdir -p $t cat < void *foo(); int main() { printf("%d\n", foo == foo()); } EOF clang -fuse-ld=`pwd`/../mold -o $t/exe $t/a.so $t/b.o $t/exe | grep -q 1 echo OK