#!/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 < int one(); int two(); struct Foo { int three(); }; int main() { Foo x; std::cout << one() << " " << two() << " " << x.three() << "\n"; } EOF clang++ -fuse-ld=`pwd`/../mold -o $t/exe $t/c.o $t/d.o $t/exe | grep -q '^1 2 3$' echo OK