#!/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/log grep -q '0000000000000000 0 NOTYPE GLOBAL DEFAULT UND fn2' $t/log grep -q '000000000003311c 0 NOTYPE GLOBAL DEFAULT 15 fn1' $t/log cat < int fn1(); void fn2() { printf("hello\n"); } int main() { fn1(); return 0; } EOF clang -fuse-ld=`pwd`/../mold -o $t/exe $t/c.o $t/b.so $t/exe | grep -q hello echo OK