-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1943 from GaloisInc/T1938
`w4_abc_{aiger,verilog}`: Handle variable-less properties correctly
- Loading branch information
Showing
6 changed files
with
61 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CC = clang | ||
CFLAGS = -g -frecord-command-line -O0 | ||
|
||
all: test.bc | ||
|
||
test.bc: test.c | ||
$(CC) $(CFLAGS) -c -emit-llvm $< -o $@ | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f test.bc |
Binary file not shown.
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,3 @@ | ||
void test(int *x) { | ||
*x = 2; | ||
} |
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,18 @@ | ||
// Test that the `abc` and `w4_abc_verilog` proof scripts will report invalid | ||
// goals that do not contain any variables. We test this both directly (with the | ||
// trivial `False` property) as well as via an LLVM verification involving a | ||
// proof goal that evaluates to `False`. | ||
|
||
fails (prove_print abc {{ False }}); | ||
fails (prove_print w4_abc_verilog {{ False }}); | ||
|
||
m <- llvm_load_module "test.bc"; | ||
|
||
// This will generate a failing proof goal about `x` being read-only. | ||
let setup = do { | ||
x <- llvm_alloc_readonly (llvm_int 32); | ||
llvm_execute_func [x]; | ||
}; | ||
|
||
fails (llvm_verify m "test" [] true setup abc); | ||
fails (llvm_verify m "test" [] true setup w4_abc_verilog); |
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,3 @@ | ||
set -e | ||
|
||
$SAW test.saw |
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