1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-21 18:08:01 +03:00
mold/test/exception.sh

32 lines
528 B
Bash
Raw Normal View History

2021-01-20 15:08:37 +03:00
#!/bin/bash
set -e
2021-03-01 10:28:16 +03:00
cd $(dirname $0)
2021-01-25 05:02:01 +03:00
echo -n "Testing $(basename -s .sh $0) ... "
2021-01-20 15:08:37 +03:00
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
cat <<EOF > $t/a.cc
int main() {
try {
throw 0;
} catch (int x) {
return x;
}
return 1;
}
EOF
2021-01-21 03:58:46 +03:00
clang++ -fuse-ld=`pwd`/../mold -o $t/exe $t/a.cc -static
$t/exe
clang++ -fuse-ld=`pwd`/../mold -o $t/exe $t/a.cc
2021-01-20 15:08:37 +03:00
$t/exe
2021-01-25 07:16:26 +03:00
clang++ -fuse-ld=`pwd`/../mold -o $t/exe $t/a.cc -Wl,--gc-sections
$t/exe
2021-01-25 07:16:27 +03:00
clang++ -fuse-ld=`pwd`/../mold -o $t/exe $t/a.cc -static -Wl,--gc-sections
$t/exe
2021-01-25 05:02:01 +03:00
echo OK