#!/bin/bash set -e cd $(dirname $0) mold=`pwd`/../../ld64.mold echo -n "Testing $(basename -s .sh $0) ... " t=$(pwd)/../../out/test/macho/$(basename -s .sh $0) mkdir -p $t cat < void hello() { printf("Hello world\n"); } int main() { hello(); } EOF clang -fuse-ld=$mold -o $t/hello $t/a.o $t/hello | grep -q 'Hello world' echo OK