-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate the oracle for Python testing
Python wheels are built in GLIBc ~ 2.17 so some functions are not demangled properly. So we rebuild them using the ir2vec binary and test the Python output against it. The ir2vec binary output is tested against the actual oracle in another workflow. So, this should be fine.
- Loading branch information
1 parent
a12c85a
commit 21397c8
Showing
4 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
cd src/test-suite | ||
|
||
rm -rf oracle | ||
|
||
SEED_VERSION="llvm12" | ||
SRC_WD="PE-benchmarks" | ||
DEST_FOLDER_LL="PE-benchmarks-llfiles-${SEED_VERSION}" | ||
DEST_FOLDER_SYM="oracle/SYM_${SEED_VERSION}_f" | ||
DEST_FOLDER_FA="oracle/FA_${SEED_VERSION}_f" | ||
DEST_FOLDER_SYM_P="oracle/SYM_${SEED_VERSION}" | ||
DEST_FOLDER_FA_P="oracle/FA_${SEED_VERSION}" | ||
|
||
mkdir -p ${DEST_FOLDER_LL} | ||
|
||
for d in ${SRC_WD}/*.c ${SRC_WD}/*.cpp ${SRC_WD}/*.cc; do | ||
name=$(basename ${d}) && oname=${name%.*} && clang -S -emit-llvm -Xclang -disable-O0-optnone ${d} -o ${DEST_FOLDER}/${oname}.ll & | ||
done | ||
wait | ||
|
||
mkdir -p ${DEST_FOLDER_SYM} | ||
mkdir -p ${DEST_FOLDER_FA} | ||
mkdir -p ${DEST_FOLDER_SYM_P} | ||
mkdir -p ${DEST_FOLDER_FA_P} | ||
|
||
IR2VEC_PATH=../../build/bin/ir2vec | ||
|
||
VOCAB_PATH="../../vocabulary/seedEmbeddingVocab-300-${SEED_VERSION}.txt" | ||
|
||
while IFS= read -r d; do | ||
${IR2VEC_PATH} -sym -vocab=${VOCAB_PATH} -o ${DEST_FOLDER_SYM}/ir2vec.txt -level f ${d} &>/dev/null | ||
${IR2VEC_PATH} -fa -vocab=${VOCAB_PATH} -o ${DEST_FOLDER_FA}/ir2vec.txt -level f ${d} &>/dev/null | ||
${IR2VEC_PATH} -sym -vocab=${VOCAB_PATH} -o ${DEST_FOLDER_SYM_P}/ir2vec.txt -level p ${d} >/dev/null | ||
${IR2VEC_PATH} -fa -vocab=${VOCAB_PATH} -o ${DEST_FOLDER_FA_P}/ir2vec.txt -level p ${d} >/dev/null | ||
done <index-${SEED_VERSION}.files | ||
wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters