#!/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 < $t/readelf ! grep -q fn1 $t/readelf ! grep -q fn2 $t/readelf ../mold -o $t/exe $t/a.o --whole-archive $t/d.a readelf --symbols $t/exe > $t/readelf grep -q fn1 $t/readelf grep -q fn2 $t/readelf ../mold -o $t/exe $t/a.o --whole-archive --no-whole-archive $t/d.a readelf --symbols $t/exe > $t/readelf ! grep -q fn1 $t/readelf ! grep -q fn2 $t/readelf echo OK