2021-07-01 03:58:18 +03:00
|
|
|
#!/bin/bash
|
2022-03-09 03:01:04 +03:00
|
|
|
export LC_ALL=C
|
2021-07-01 03:58:18 +03:00
|
|
|
set -e
|
2022-01-07 06:51:36 +03:00
|
|
|
CC="${CC:-cc}"
|
|
|
|
CXX="${CXX:-c++}"
|
2022-01-24 04:21:08 +03:00
|
|
|
testname=$(basename "$0" .sh)
|
2021-12-30 05:11:06 +03:00
|
|
|
echo -n "Testing $testname ... "
|
|
|
|
cd "$(dirname "$0")"/../..
|
|
|
|
mold="$(pwd)/mold"
|
2022-01-07 12:06:53 +03:00
|
|
|
t=out/test/elf/$testname
|
|
|
|
mkdir -p $t
|
2021-07-01 03:58:18 +03:00
|
|
|
|
2021-12-22 13:38:00 +03:00
|
|
|
ldd "$mold"-wrapper.so | grep -q libasan && { echo skipped; exit; }
|
2021-07-20 07:30:16 +03:00
|
|
|
|
2022-01-07 12:06:53 +03:00
|
|
|
rm -rf $t
|
|
|
|
mkdir -p $t/bin $t/lib/mold
|
|
|
|
cp "$mold" $t/bin
|
|
|
|
cp "$mold"-wrapper.so $t/bin
|
2021-07-01 03:58:18 +03:00
|
|
|
|
2022-01-07 12:06:53 +03:00
|
|
|
$t/bin/mold -run bash -c 'echo $LD_PRELOAD' | grep -q '/bin/mold-wrapper.so'
|
2021-07-01 03:58:18 +03:00
|
|
|
|
|
|
|
echo OK
|