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 * Update the binfmt-support postinstall to match what is done elsewhere
in Debian in Debian
* Add binfmt-support to one of the autopkgtest tests * Add binfmt-support to one of the autopkgtest tests
And make sure that the test is only executed when installed correctly
Otherwise, fails with Otherwise, fails with
"./foo.bc: cannot execute binary file: Exec format error" "./foo.bc: cannot execute binary file: Exec format error"

View File

@ -290,8 +290,11 @@ if ! lli-$VERSION opt.ll|grep -q "lli foo"; then
lli-$VERSION opt.ll lli-$VERSION opt.ll
exit 1 exit 1
fi fi
clang-$VERSION -O3 -emit-llvm foo.c -c -o foo.bc clang-$VERSION -O3 -emit-llvm foo.c -c -o foo.bc
chmod +x foo.bc chmod +x foo.bc
# 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 if ! ./foo.bc|grep -q "lli foo"; then
echo "executing ./foo.bc failed" echo "executing ./foo.bc failed"
./foo.bc ./foo.bc
@ -305,6 +308,8 @@ if ! ./foo.bc|grep -q "lli foo"; then
./foo.bc ./foo.bc
exit 1 exit 1
fi fi
fi # binfmt test
if ! llvm-dis-$VERSION < foo.bc|grep -q "lli foo"; then if ! llvm-dis-$VERSION < foo.bc|grep -q "lli foo"; then
echo "llvm assembly code failed" echo "llvm assembly code failed"
llvm-dis-$VERSION < foo.bc llvm-dis-$VERSION < foo.bc