Skip to content

Commit bd30040

Browse files
author
ed sandberg
committed
Fix test2028_vacuity_detect
- Removed LLVM proof from test2028_vacuity_detect since vacuity detection for LLVM is already covered by test0064. - Fixed quoting of $SAW in test.sh to allow proper execution via test runner. Related to GaloisInc#2028.
1 parent 03e1382 commit bd30040

File tree

7 files changed

+11
-23
lines changed

7 files changed

+11
-23
lines changed

intTests/test2028_vacuity_detect/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
all: test.bc test.linked-mir.json Test.class
2-
3-
test.bc: test.c
4-
clang -emit-llvm -c -o $@ $<
1+
all: test.linked-mir.json Test.class
52

63
test.linked-mir.json: test.rs
74
saw-rustc $<
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
This test checks for vacuous proofs across LLVM, MIR, and JVM backends.
1+
This test checks for vacuous proofs in the MIR, and JVM backends. It skips
2+
LLVM as that is already tested in test0064.
23

34
It corresponds to issue https://github.com/GaloisInc/saw-script/issues/2028
45

5-
Each function includes a contradictory precondition (e.g., x != x), and SAW should detect this
6-
and emit a vacuity warning before successfully proving the function.
6+
Each function includes a contradictory precondition (e.g., x != x), and SAW
7+
should detect this and emit a vacuity warning before successfully proving the
8+
function.
-2.11 KB
Binary file not shown.

intTests/test2028_vacuity_detect/test.c

Lines changed: 0 additions & 2 deletions
This file was deleted.

intTests/test2028_vacuity_detect/test.saw

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
// test.saw
22
enable_experimental;
33

4-
let fun_c_spec = do {
5-
x <- llvm_fresh_var "x" (llvm_int 32);
6-
llvm_precond {{ x != x }};
7-
llvm_execute_func [];
8-
};
9-
llvm_mod <- llvm_load_module "test.bc";
10-
llvm_verify llvm_mod "fun_c" [] false fun_c_spec z3;
11-
124
let fun_rs_spec = do {
135
x <- mir_fresh_var "x" mir_u32;
146
mir_precond {{ x != x }};
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22

3-
n=$( "$SAW" --detect-vacuity test.saw 2>&1 | tee /dev/stderr | grep -c "Contradiction detected" )
3+
n=$( $SAW --detect-vacuity test.saw 2>&1 | tee /dev/stderr | grep -c "Contradiction detected" )
44

5-
if [ "$n" -eq 3 ]; then
6-
echo "Found 3 expected contradictions"
5+
if [ "$n" -eq 2 ]; then
6+
echo "Found 2 expected contradictions"
77
exit 0
88
else
9-
echo "Expected 3 contradictions, found $n"
9+
echo "Expected 2 contradictions, found $n"
1010
exit 1
1111
fi

saw-central/src/SAWCentral/Crucible/LLVM/Builtins.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ import qualified Lang.Crucible.LLVM.Translation as Crucible
175175

176176
import qualified SAWCentral.Crucible.LLVM.CrucibleLLVM as Crucible
177177

178-
import qualified SAWCentral.Crucible.Common.Vacuity as Vacuity
179-
180178
-- parameterized-utils
181179
import qualified Data.Parameterized.TraversableFC as Ctx
182180

@@ -212,6 +210,7 @@ import SAWCentral.Crucible.Common.MethodSpec (SetupValue(..))
212210
import SAWCentral.Crucible.Common.Override
213211
import qualified SAWCentral.Crucible.Common.Setup.Builtins as Setup
214212
import qualified SAWCentral.Crucible.Common.Setup.Type as Setup
213+
import qualified SAWCentral.Crucible.Common.Vacuity as Vacuity
215214

216215
import SAWCentral.Crucible.LLVM.Override
217216
import SAWCentral.Crucible.LLVM.ResolveSetupValue

0 commit comments

Comments
 (0)