1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-04 16:48:04 +03:00
mold/test/empty-file.sh
Rui Ueyama f127281d05 Allow empty input files
mmap(2) fails if you pass 0 as an argument for `length` parameter,
so this case has to be handled as a special case.

This is needed by Gentoo's media-plugins/calf-0.90.3-r1 package.
2021-06-21 09:33:35 +09:00

22 lines
385 B
Bash
Executable File

#!/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 <<EOF | cc -o $t/a.o -c -xc -
#include <stdio.h>
int main() {
printf("Hello world\n");
}
EOF
rm -f $t/b.script
touch $t/b.script
clang -fuse-ld=`pwd`/../mold -o $t/exe $t/a.o -Wl,--version-script,$t/b.script
$t/exe | grep -q 'Hello world'
echo OK