2021-02-27 07:44:30 +03:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
2021-03-01 10:28:16 +03:00
|
|
|
cd $(dirname $0)
|
2021-02-27 07:44:30 +03:00
|
|
|
echo -n "Testing $(basename -s .sh $0) ..."
|
|
|
|
t=$(pwd)/tmp/$(basename -s .sh $0)
|
|
|
|
mkdir -p $t
|
|
|
|
|
2021-03-21 07:31:38 +03:00
|
|
|
cat <<EOF | g++ -c -o $t/a.o -g -gz=zlib-gnu -xc++ -
|
2021-02-27 07:44:30 +03:00
|
|
|
int main() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
2021-03-21 07:31:38 +03:00
|
|
|
cat <<EOF | g++ -c -o $t/b.o -g -gz=zlib -xc++ -
|
2021-02-27 07:44:30 +03:00
|
|
|
int foo() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
clang -fuse-ld=`pwd`/../mold -o $t/exe $t/a.o $t/b.o
|
2021-06-05 14:50:53 +03:00
|
|
|
dwarfdump $t/exe > /dev/null
|
|
|
|
readelf --sections $t/exe | fgrep -q .debug_info
|
2021-02-27 07:44:30 +03:00
|
|
|
|
|
|
|
echo ' OK'
|