rlo-issue-112061/checkllvm.sh
2023-05-30 16:46:04 +02:00

15 lines
No EOL
318 B
Bash
Executable file

#!/usr/bin/env bash
rustc code.rs --crate-name ll -Zmir-enable-passes=-ConstProp --emit llvm-ir -Cno-prepopulate-passes --crate-type=lib
clang ll.ll helper.c -O1 -o good
clang ll.ll helper.c -O2 -o bad
bad=$(./bad)
good=$(./good)
if [ "$good" != "$bad" ]; then
echo "MISCOMPILATION"
else
echo "no repro"
fi