Skip to content

Commit

Permalink
update csmith gen
Browse files Browse the repository at this point in the history
  • Loading branch information
ailrst committed Dec 10, 2024
1 parent b530a28 commit 293c5c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions examples/csmith/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
*.c
*.relf
*.bir
platform.info
9 changes: 5 additions & 4 deletions examples/csmith/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ ADTS=$(addsuffix .adt,$(SOURCENAMES))
OUTS=$(addsuffix .out,$(SOURCENAMES))
CHECKSUMS=$(addsuffix .checksum,$(SOURCENAMES))

CSMITH_HEADER ?= "/usr/include/csmith/"
CC=clang -target aarch64-linux-gnu
CSMITH_INCLUDE ?= /usr/include/csmith
CSMITH_HEADER = $(CSMITH_INCLUDE)
CC ?=clang -target aarch64-linux-gnu

%.out : %.c
$(CC) $< -w -I $(CSMITH_HEADER) -o $@
$(CC) $< -I$(CSMITH_HEADER) -w -o $@

%.relf : %.out
readelf -s -r -w $< > $@
Expand All @@ -19,7 +20,7 @@ CC=clang -target aarch64-linux-gnu
bap $< -d adt:$@

%.checksum : %.c
clang -w -I $(CSMITH_HEADER) $< -o $<.out && ./$<.out || true
$(CC) -w -I $(CSMITH_HEADER) $< -o $<.out && ./$<.out || true

default : $(ADTS) $(RELFS)

Expand Down
1 change: 0 additions & 1 deletion examples/csmith/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# produces programs that we can't handle
# cmd = ["csmith", "--seed", str(seed), "--max-block-size", str(max_blocksize), "--max-funcs", str(max_funcs), "--output", f"{fname}.c"]

csmith_header = "/usr/include/csmith/"
csmith_safe = "--no-arrays --no-bitfields --no-checksum --no-comma-operators --no-longlong --no-int8 --no-uint8 --no-float --no-math64 --no-inline-function --no-safe-math --no-packed-struct --no-pointers --no-structs --no-unions --no-volatile-pointers --no-const-pointers".split(" ")

files = []
Expand Down

0 comments on commit 293c5c7

Please sign in to comment.