Skip to content

Commit

Permalink
Merge pull request #1695 from GaloisInc/T1691
Browse files Browse the repository at this point in the history
Fix #1691 by bringing in GaloisInc/crucible#1004
  • Loading branch information
mergify[bot] authored Jun 24, 2022
2 parents f6c58db + 26f2478 commit 4666760
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deps/crucible
Submodule crucible updated 147 files
2 changes: 1 addition & 1 deletion deps/llvm-pretty
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 4666760

Please sign in to comment.