Skip to content

Commit

Permalink
Fix #1691 by bringing in GaloisInc/crucible#1004
Browse files Browse the repository at this point in the history
Now that the `crucible-llvm` memory model has a fix for
GaloisInc/crucible#1004, bumping the `crucible` submodule to bring in that
change fixes #1691 as a consequence. I have also added a regression test.
  • Loading branch information
RyanGlScott committed Jun 24, 2022
1 parent f7ee740 commit 26f2478
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deps/crucible
11 changes: 11 additions & 0 deletions intTests/test1691/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CC = clang
CFLAGS = -g -emit-llvm -frecord-command-line -O0

all: test.bc

test.bc: test.c
$(CC) $(CFLAGS) -c $< -o $@

.PHONY: clean
clean:
rm -f test.bc
Binary file added intTests/test1691/test.bc
Binary file not shown.
8 changes: 8 additions & 0 deletions intTests/test1691/test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
struct s {
unsigned x:1;
unsigned y:1;
};

int f(const struct s *ss) {
return ss->x == ss->y;
}
17 changes: 17 additions & 0 deletions intTests/test1691/test.saw
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
enable_experimental;
enable_lax_loads_and_stores;

let f_spec = do {
ss <- llvm_alloc_readonly (llvm_alias "struct.s");
x <- llvm_fresh_var "x" (llvm_int 1);
y <- llvm_fresh_var "y" (llvm_int 1);
llvm_points_to_bitfield ss "x" (llvm_term x);
llvm_points_to_bitfield ss "y" (llvm_term y);

llvm_execute_func [ss];

llvm_return (llvm_term {{ if x == y then 1 else 0 : [32] }});
};

m <- llvm_load_module "test.bc";
ov <- llvm_verify m "f" [] false f_spec (w4_unint_yices []);
3 changes: 3 additions & 0 deletions intTests/test1691/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set -e

$SAW test.saw

0 comments on commit 26f2478

Please sign in to comment.