Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1691 by bringing in GaloisInc/crucible#1004 #1695

Merged
merged 2 commits into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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