#!/bin/bash set -e mold=$1 cd $(dirname $0) echo -n "Testing $(basename -s .sh $0) ... " t=$(pwd)/tmp/$(basename -s .sh $0) mkdir -p $t cat < $t/log ! fgrep -q 'multiple common symbols' $t/log || false clang -fuse-ld=$mold -o $t/exe $t/a.o $t/b.o -Wl,-warn-common 2> $t/log fgrep -q 'multiple common symbols' $t/log echo OK