Files
conflict-set/test_symbols.sh
Andrew Noyes c1129ed0e2
Some checks reported errors
Tests / Clang total: 1096, failed: 2, passed: 1094
Tests / SIMD fallback total: 1096, failed: 2, passed: 1094
weaselab/conflict-set/pipeline/head Something is wrong with the build of this commit
Add symbol imports file
2024-04-03 12:32:28 -07:00

16 lines
418 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
# ./test_symbols.sh <library> <expected exported symbols file> <allowed imported symbols file>
diff -u <(sort < "$2") <(nm "$1" | grep " T " | cut -f3 -d " " | sort)
ec=0
for symbol in $(nm "$1" | grep " U " | sed 's/ U //') ; do
if ! grep --fixed-strings "$symbol" "$3" > /dev/null ; then
echo "Imported symbol $symbol not present in $3"
ec=1
fi
done
exit $ec