And make sure that the test is only executed when installed correctly

This commit is contained in:
Sylvestre Ledru 2020-07-08 14:05:27 +02:00
parent 7e32284efe
commit 0d085612b3
2 changed files with 18 additions and 12 deletions

1
debian/changelog vendored
View File

@ -4,6 +4,7 @@ llvm-toolchain-10 (1:10.0.1~+rc4-1) unstable; urgency=medium
* Update the binfmt-support postinstall to match what is done elsewhere
in Debian
* Add binfmt-support to one of the autopkgtest tests
And make sure that the test is only executed when installed correctly
Otherwise, fails with
"./foo.bc: cannot execute binary file: Exec format error"

View File

@ -290,21 +290,26 @@ if ! lli-$VERSION opt.ll|grep -q "lli foo"; then
lli-$VERSION opt.ll
exit 1
fi
clang-$VERSION -O3 -emit-llvm foo.c -c -o foo.bc
chmod +x foo.bc
if ! ./foo.bc|grep -q "lli foo"; then
echo "executing ./foo.bc failed"
./foo.bc
exit 1
fi
clang-$VERSION -O3 -emit-llvm foo.c -c -o foo.bc
chmod +x foo.bc
if ! ./foo.bc|grep -q "lli foo"; then
echo "executing ./foo.bc failed"
./foo.bc
exit 1
fi
# only run if the binfmt is installed correctly
if /usr/sbin/update-binfmts --display llvm-$VERSION-runtime.binfmt &> /dev/null; then
if ! ./foo.bc|grep -q "lli foo"; then
echo "executing ./foo.bc failed"
./foo.bc
exit 1
fi
clang-$VERSION -O3 -emit-llvm foo.c -c -o foo.bc
chmod +x foo.bc
if ! ./foo.bc|grep -q "lli foo"; then
echo "executing ./foo.bc failed"
./foo.bc
exit 1
fi
fi # binfmt test
if ! llvm-dis-$VERSION < foo.bc|grep -q "lli foo"; then
echo "llvm assembly code failed"
llvm-dis-$VERSION < foo.bc