Remove temporary files

Ensure s390x-asm-unsupported-pc-relative-addr and shlibs-cet-support
remove temporary files after a successful execution.
This commit is contained in:
Tulio Magno Quites Machado Filho 2024-11-14 09:38:58 -03:00
commit de1663d7a9
2 changed files with 10 additions and 2 deletions

View file

@ -1,8 +1,12 @@
#!/bin/bash -eux
cd "$(mktemp -d)"
tmp=$(mktemp -d)
pushd "$tmp"
# This asm has an invalid PC relative address.
echo "start: la %r2,_end-start(%r2)" > test.S
# clang should fail to build and inform properly about the issue.
clang -c -o test.o test.S |& tee clang.output ||:
grep -q "Unsupported PC-relative address" clang.output
popd
# On failure, the script will abort and tmp won't be removed.
rm -rf "$tmp"

View file

@ -1,9 +1,13 @@
#!/bin/bash -eux
cd "$(mktemp -d)"
tmp=$(mktemp -d)
pushd "$tmp"
for lib in $(rpm -ql llvm-libs | grep -E '\.so(\..+)?$'); do
[[ -L $lib ]] && continue # Skip symlinks
readelf -n "$lib" > notes.log
grep -q "SHSTK" notes.log
grep -q "IBT" notes.log
done
popd
# On failure, the script will abort and tmp won't be removed.
rm -rf "$tmp"