Files
llvm/libclc/check_external_funcs.sh
Wenju He 7d1adab5a6 [libclc] Fix ctest failures after 7f3661128b: adjust external check and make shuffle helpers static (#160036)
* Replace call-site check with external declaration scan (grep declare)
to avoid false positives for not-inlined __clc_* functions.
* _clc_get_el* helpers are defined as inline in clc_shuffle2.cl, so they
have available_externally attribute. When they fail to inline they are
deleted by EliminateAvailableExternallyPass and become unresolved in
cedar-r600--.bc. Mark them static to resolve the issue.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-22 15:55:49 +08:00

31 lines
580 B
Bash
Executable File

#!/bin/sh
FILE=$1
BIN_DIR=$2
if [ ! -f $FILE ]; then
echo "ERROR: Not a file: $FILE"
exit 3
fi
ret=0
DIS="$BIN_DIR/llvm-dis"
if [ ! -x $DIS ]; then
echo "ERROR: Disassembler '$DIS' is not executable"
exit 3
fi
TMP_FILE=$(mktemp)
# Check for external functions. Calls to llvm intrinsics are OK
$DIS < $FILE | grep '^[[:space:]]*declare ' | grep -v '@llvm' > "$TMP_FILE"
COUNT=$(wc -l < "$TMP_FILE")
if [ "$COUNT" -ne "0" ]; then
echo "ERROR: $COUNT unresolved external functions detected in $FILE"
cat $TMP_FILE
ret=1
else
echo "File $FILE is OK"
fi
exit $ret