1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-04 16:48:04 +03:00
mold/test/macho/hello2.sh

23 lines
375 B
Bash
Raw Normal View History

2021-10-26 09:26:08 +03:00
#!/bin/bash
export LANG=
2021-10-26 09:26:08 +03:00
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 <<EOF | cc -o $t/a.o -c -xc -
#include <stdio.h>
int main() {
printf("Hello");
2021-10-26 10:38:44 +03:00
puts(" world");
2021-10-26 09:26:08 +03:00
}
EOF
clang -fuse-ld=$mold -o $t/exe $t/a.o
$t/exe | grep -q 'Hello world'
echo OK