From 1ba5be2ed2c4ea0010d3d89fbab08690a05c272f Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Tue, 30 May 2023 16:57:03 +0200 Subject: [PATCH] fix llvm reduce --- checkllvm.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/checkllvm.sh b/checkllvm.sh index 2498ffa..ed0b5ab 100755 --- a/checkllvm.sh +++ b/checkllvm.sh @@ -1,9 +1,11 @@ #!/usr/bin/env bash -rustc code.rs --crate-name ll -Zmir-enable-passes=-ConstProp --emit llvm-ir -Cno-prepopulate-passes --crate-type=lib +set -eu -clang ll.ll helper.c -O1 -o good -clang ll.ll helper.c -O2 -o bad +# rustc code.rs --crate-name ll -Zmir-enable-passes=-ConstProp --emit llvm-ir -Cno-prepopulate-passes --crate-type=lib + +clang $1 helper.c -O1 -o good +clang $1 helper.c -O2 -o bad bad=$(./bad) good=$(./good) @@ -12,4 +14,5 @@ if [ "$good" != "$bad" ]; then echo "MISCOMPILATION" else echo "no repro" + exit 1 fi \ No newline at end of file