Skip to content

Commit

Permalink
recursive make lifting setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ailrst committed Dec 4, 2023
1 parent ad1c0cb commit bdab873
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 3,107 deletions.
709 changes: 0 additions & 709 deletions examples/memcpy-variants/beans

This file was deleted.

691 changes: 0 additions & 691 deletions examples/memcpy-variants/example.bpl.orig

This file was deleted.

12 changes: 0 additions & 12 deletions examples/memcpy-variants/example.bpl.rej

This file was deleted.

1,007 changes: 0 additions & 1,007 deletions examples/memcpy-variants/iterator.log

This file was deleted.

Empty file.
688 changes: 0 additions & 688 deletions examples/memcpy-variants/smtout.log

This file was deleted.

30 changes: 30 additions & 0 deletions src/test/make/lift-directories.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

.EXPORT_ALL_VARIABLES:
NAME=$(shell basename $(PWD))

CC=aarch64-linux-gnu-gcc
#CFLAGS=-fno-pic -fno-plt
TARGET=aarch64-linux-gnu

BAP=bap-aslp
READELF=aarch64-linux-gnu-readelf
BASIL=$(realpath ../../../../target/scala-3.3.1/wptool-boogie-assembly-0.0.1.jar)

C_SOURCE=$(realpath $(wildcard *.c))
SPEC=$(realpath $(wildcard *.spec))
EXTRA_SPEC=$(realpath $(wildcard *.bpl))
BASIL_FLAGS=--boogie-use-lambda-stores
BOOGIE_FLAGS=/proverOpt:O:smt.array.extensional=false

LIFT_ARTEFACTS=$(NAME).adt $(NAME).bir $(NAME).relf

SUBDIRS := $(wildcard */.)

TARGETS := all verify
.PHONY : $(TARGETS) $(SUBDIRS)

$(TARGETS): $(SUBDIRS)

$(SUBDIRS):
-$(MAKE) -C $@ $(MAKECMDGOALS)

18 changes: 18 additions & 0 deletions src/test/make/lift.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

$(NAME).bpl: $(LIFT_ARTEFACTS)
echo $(BASIL)
java -jar $(BASIL) $(BASIL_FLAGS) --adt $(NAME).adt --relf $(NAME).relf -o $(NAME).bpl --spec $(SPEC)

$(LIFT_ARTEFACTS): a.out
$(BAP) a.out -d adt:$(NAME).adt -d bir:$(NAME).bir
$(READELF) -s -r -W a.out > $(NAME).relf

a.out: $(C_SOURCE)
$(CC) $(CFLAGS) $(C_SOURCE)

.PHONY=verify
verify: $(NAME)_result.txt

$(NAME)_result.txt: $(NAME).bpl $(EXTRA_SPEC)
boogie $(NAME).bpl $(EXTRA_SPEC) $(BOOGIE_FLAGS) | tee $(NAME)_result.txt

0 comments on commit bdab873

Please sign in to comment.