From 81a2cfe0971ca2456ff04c1e661b9a56279728ac Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Fri, 17 Sep 2021 11:15:32 +0200 Subject: test for many parameters --- test/monniaux/params/call_many.c | 313 -------------------------------- test/regression/Makefile | 2 +- test/regression/Results/many_parameters | 1 + test/regression/many_parameters.c | 313 ++++++++++++++++++++++++++++++++ 4 files changed, 315 insertions(+), 314 deletions(-) delete mode 100644 test/monniaux/params/call_many.c create mode 100644 test/regression/Results/many_parameters create mode 100644 test/regression/many_parameters.c (limited to 'test') diff --git a/test/monniaux/params/call_many.c b/test/monniaux/params/call_many.c deleted file mode 100644 index 4d2529c0..00000000 --- a/test/monniaux/params/call_many.c +++ /dev/null @@ -1,313 +0,0 @@ -#include - -int call1( - int call00, - int call01, - int call02, - int call03, - int call04, - int call05, - int call06, - int call07, - int call08, - int call09, - int call10, - int call11, - int call12, - int call13, - int call14, - int call15, - int call16, - int call17, - int call18, - int call19, - int call20, - int call21, - int call22, - int call23, - int call24, - int call25, - int call26, - int call27, - int call28, - int call29, - int call30, - int call31, - int call32, - int call33, - int call34, - int call35, - int call36, - int call37, - int call38, - int call39, - int call40, - int call41, - int call42, - int call43, - int call44, - int call45, - int call46, - int call47, - int call48, - int call49, - int call50, - int call51, - int call52, - int call53, - int call54, - int call55, - int call56, - int call57, - int call58, - int call59) { - return ( call00 - + call01 - + call02 - + call03 - + call04 - + call05 - + call06 - + call07 - + call08 - + call09 - + call10 - + call11 - + call12 - + call13 - + call14 - + call15 - + call16 - + call17 - + call18 - + call19 - + call20 - + call21 - + call22 - + call23 - + call24 - + call25 - + call26 - + call27 - + call28 - + call29 - + call30 - + call31 - + call32 - + call33 - + call34 - + call35 - + call36 - + call37 - + call38 - + call39 - + call40 - + call41 - + call42 - + call43 - + call44 - + call45 - + call46 - + call47 - + call48 - + call49 - + call50 - + call51 - + call52 - + call53 - + call54 - + call55 - + call56 - + call57 - + call58 - + call59); -} - -int call2( - int call00, - int call01, - int call02, - int call03, - int call04, - int call05, - int call06, - int call07, - int call08, - int call09, - int call10, - int call11, - int call12, - int call13, - int call14, - int call15, - int call16, - int call17, - int call18, - int call19, - int call20, - int call21, - int call22, - int call23, - int call24, - int call25, - int call26, - int call27, - int call28, - int call29, - int call30, - int call31, - int call32, - int call33, - int call34, - int call35, - int call36, - int call37, - int call38, - int call39, - int call40, - int call41, - int call42, - int call43, - int call44, - int call45, - int call46, - int call47, - int call48, - int call49, - int call50, - int call51, - int call52, - int call53, - int call54, - int call55, - int call56, - int call57, - int call58, - int call59) { - return 10 + call1( - call00, - call01, - call02, - call03, - call04, - call05, - call06, - call07, - call08, - call09, - call10, - call11, - call12, - call13, - call14, - call15, - call16, - call17, - call18, - call19, - call20, - call21, - call22, - call23, - call24, - call25, - call26, - call27, - call28, - call29, - call30, - call31, - call32, - call33, - call34, - call35, - call36, - call37, - call38, - call39, - call40, - call41, - call42, - call43, - call44, - call45, - call46, - call47, - call48, - call49, - call50, - call51, - call52, - call53, - call54, - call55, - call56, - call57, - call58, - call59); -} - -int main() { - int x = - call2( 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 46, - 47, - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 57, - 58, - 59); - printf("%d\n", x); -} diff --git a/test/regression/Makefile b/test/regression/Makefile index 9661a99e..0f9e368f 100644 --- a/test/regression/Makefile +++ b/test/regression/Makefile @@ -18,7 +18,7 @@ TESTS?=int32 int64 floats floats-basics floats-lit \ funct3 expr5 struct7 struct8 struct11 struct12 casts1 casts2 char1 \ sizeof1 sizeof2 binops bool for1 for2 switch switch2 compound \ decl1 bitfields9 ptrs3 \ - parsing krfun ifconv + parsing krfun ifconv many_parameters # Can run, but only in compiled mode, and have reference output in Results diff --git a/test/regression/Results/many_parameters b/test/regression/Results/many_parameters new file mode 100644 index 00000000..838cfd7e --- /dev/null +++ b/test/regression/Results/many_parameters @@ -0,0 +1 @@ +1780 diff --git a/test/regression/many_parameters.c b/test/regression/many_parameters.c new file mode 100644 index 00000000..4d2529c0 --- /dev/null +++ b/test/regression/many_parameters.c @@ -0,0 +1,313 @@ +#include + +int call1( + int call00, + int call01, + int call02, + int call03, + int call04, + int call05, + int call06, + int call07, + int call08, + int call09, + int call10, + int call11, + int call12, + int call13, + int call14, + int call15, + int call16, + int call17, + int call18, + int call19, + int call20, + int call21, + int call22, + int call23, + int call24, + int call25, + int call26, + int call27, + int call28, + int call29, + int call30, + int call31, + int call32, + int call33, + int call34, + int call35, + int call36, + int call37, + int call38, + int call39, + int call40, + int call41, + int call42, + int call43, + int call44, + int call45, + int call46, + int call47, + int call48, + int call49, + int call50, + int call51, + int call52, + int call53, + int call54, + int call55, + int call56, + int call57, + int call58, + int call59) { + return ( call00 + + call01 + + call02 + + call03 + + call04 + + call05 + + call06 + + call07 + + call08 + + call09 + + call10 + + call11 + + call12 + + call13 + + call14 + + call15 + + call16 + + call17 + + call18 + + call19 + + call20 + + call21 + + call22 + + call23 + + call24 + + call25 + + call26 + + call27 + + call28 + + call29 + + call30 + + call31 + + call32 + + call33 + + call34 + + call35 + + call36 + + call37 + + call38 + + call39 + + call40 + + call41 + + call42 + + call43 + + call44 + + call45 + + call46 + + call47 + + call48 + + call49 + + call50 + + call51 + + call52 + + call53 + + call54 + + call55 + + call56 + + call57 + + call58 + + call59); +} + +int call2( + int call00, + int call01, + int call02, + int call03, + int call04, + int call05, + int call06, + int call07, + int call08, + int call09, + int call10, + int call11, + int call12, + int call13, + int call14, + int call15, + int call16, + int call17, + int call18, + int call19, + int call20, + int call21, + int call22, + int call23, + int call24, + int call25, + int call26, + int call27, + int call28, + int call29, + int call30, + int call31, + int call32, + int call33, + int call34, + int call35, + int call36, + int call37, + int call38, + int call39, + int call40, + int call41, + int call42, + int call43, + int call44, + int call45, + int call46, + int call47, + int call48, + int call49, + int call50, + int call51, + int call52, + int call53, + int call54, + int call55, + int call56, + int call57, + int call58, + int call59) { + return 10 + call1( + call00, + call01, + call02, + call03, + call04, + call05, + call06, + call07, + call08, + call09, + call10, + call11, + call12, + call13, + call14, + call15, + call16, + call17, + call18, + call19, + call20, + call21, + call22, + call23, + call24, + call25, + call26, + call27, + call28, + call29, + call30, + call31, + call32, + call33, + call34, + call35, + call36, + call37, + call38, + call39, + call40, + call41, + call42, + call43, + call44, + call45, + call46, + call47, + call48, + call49, + call50, + call51, + call52, + call53, + call54, + call55, + call56, + call57, + call58, + call59); +} + +int main() { + int x = + call2( 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59); + printf("%d\n", x); +} -- cgit From 613848182d167782fa5ee383b0e73b87e5ef1351 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Fri, 17 Sep 2021 14:54:49 +0200 Subject: Select condition x < 0 with x unsigned leads to false Squashed commit of the following: commit 808e72db2022d05a4e34818b33cc9af17aaa4df0 Author: David Monniaux Date: Fri Sep 17 14:53:39 2021 +0200 selectOp for comp0 commit f38e1f15359cceb3c0764635336125a1ceae78ff Author: David Monniaux Date: Fri Sep 17 14:49:45 2021 +0200 SelectOp for ccomp0 ok commit ca969280380a593aef590a1fe2ec6f0fc112c2f5 Author: David Monniaux Date: Fri Sep 17 14:46:01 2021 +0200 progress commit e60a970f541ae6be30ec51cf95d60eb672ade829 Author: David Monniaux Date: Fri Sep 17 14:40:49 2021 +0200 progres sur ltu etc. commit 6f7d51e59a61d43fca06b1b4bad6dedada6e031e Author: David Monniaux Date: Fri Sep 17 14:13:07 2021 +0200 change selection commit c2af349c6dd3e09fec25f3a96e1272377b6450ef Author: David Monniaux Date: Fri Sep 17 14:03:31 2021 +0200 begin rewrite selector --- test/monniaux/codegen/comp0.c | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 test/monniaux/codegen/comp0.c (limited to 'test') diff --git a/test/monniaux/codegen/comp0.c b/test/monniaux/codegen/comp0.c new file mode 100644 index 00000000..60f8ba77 --- /dev/null +++ b/test/monniaux/codegen/comp0.c @@ -0,0 +1,3 @@ +int toto(unsigned x) { + return (x < 0) ? 1 : 2; +} -- cgit From 32c90e36e4018a5a49a0a45e2e98a9c94c0d185d Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Fri, 17 Sep 2021 15:08:22 +0200 Subject: some csmith tests --- test/monniaux/csmith/Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/monniaux/csmith/Makefile b/test/monniaux/csmith/Makefile index aa4eccab..e6475fa2 100644 --- a/test/monniaux/csmith/Makefile +++ b/test/monniaux/csmith/Makefile @@ -1,9 +1,13 @@ +all: + +.SECONDARY: + INCLUDES=-I csmith/include/csmith-2.3.0/ TARGET_CCOMP=../../../ccomp -TARGET_CC=gcc +TARGET_CC=kvx-cos-gcc ifndef EXECUTE -EXECUTE=timeout 2s +EXECUTE=timeout 10s kvx-cluster -- endif CFLAGS += -Wno-incompatible-pointer-types @@ -11,8 +15,9 @@ CFLAGS += -Wno-incompatible-pointer-types ifndef CSMITH CSMITH=csmith/bin/csmith endif +CSMITHOPT=--max-funcs 10 -MAX=300 +MAX=10000 PREFIX=ran%06.f CCOMPOTS=-static @@ -69,7 +74,7 @@ ran%/example.gcc.host: ran%/source.gcc.host.o ran%/source.c: mkdir -p ran$* - $(CSMITH) --seed $* --output ran$*/source.c + $(CSMITH) $(CSMITHOPT) --seed $* --output ran$*/source.c ran%/example.target.cmp : ran%/example.gcc.target.out ran%/example.ccomp.target.out cmp $+ > $@ -- cgit From 124cd837a591df308221f236810c7f66847b1abe Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Fri, 17 Sep 2021 19:18:05 +0200 Subject: target cc --- test/monniaux/csmith/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/monniaux/csmith/Makefile b/test/monniaux/csmith/Makefile index e6475fa2..f4b0d68a 100644 --- a/test/monniaux/csmith/Makefile +++ b/test/monniaux/csmith/Makefile @@ -4,7 +4,10 @@ all: INCLUDES=-I csmith/include/csmith-2.3.0/ TARGET_CCOMP=../../../ccomp + +ifndef TARGET_CC TARGET_CC=kvx-cos-gcc +endif ifndef EXECUTE EXECUTE=timeout 10s kvx-cluster -- @@ -21,7 +24,7 @@ MAX=10000 PREFIX=ran%06.f CCOMPOTS=-static -CCOMPFLAGS+= -fstruct-passing -fbitfields -fno-cse2 -stdlib ../../../runtime +CCOMPFLAGS+= -fstruct-passing -fbitfields -fno-cse2 -fno-cse -fno-cse3 -stdlib ../../../runtime TESTS_C=$(shell seq --format $(PREFIX)/source.c 1 $(MAX)) -- cgit From fd6f8114d91f1649e467571b39adcb0b8fa2f92e Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sat, 18 Sep 2021 10:18:34 +0200 Subject: reduce number of csmith tests --- test/monniaux/csmith/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/monniaux/csmith/Makefile b/test/monniaux/csmith/Makefile index f4b0d68a..30107695 100644 --- a/test/monniaux/csmith/Makefile +++ b/test/monniaux/csmith/Makefile @@ -20,7 +20,7 @@ CSMITH=csmith/bin/csmith endif CSMITHOPT=--max-funcs 10 -MAX=10000 +MAX=5000 PREFIX=ran%06.f CCOMPOTS=-static -- cgit From 68995e0afca237658728b2c82fff04133a5aae72 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sat, 18 Sep 2021 12:47:14 +0200 Subject: fix for x86-64 --- test/monniaux/csmith/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/monniaux/csmith/Makefile b/test/monniaux/csmith/Makefile index 30107695..ab7931f1 100644 --- a/test/monniaux/csmith/Makefile +++ b/test/monniaux/csmith/Makefile @@ -6,7 +6,7 @@ INCLUDES=-I csmith/include/csmith-2.3.0/ TARGET_CCOMP=../../../ccomp ifndef TARGET_CC -TARGET_CC=kvx-cos-gcc +TARGET_CC=gcc endif ifndef EXECUTE -- cgit From a4c242f24d02bc69853b21071bc34beff8f31d3b Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sun, 19 Sep 2021 09:59:03 +0200 Subject: creduce scripts --- test/monniaux/csmith/reduce/reduce.sh | 15 +++++++++++++++ test/monniaux/csmith/reduce/reduce_wrt_host.sh | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100755 test/monniaux/csmith/reduce/reduce.sh create mode 100755 test/monniaux/csmith/reduce/reduce_wrt_host.sh (limited to 'test') diff --git a/test/monniaux/csmith/reduce/reduce.sh b/test/monniaux/csmith/reduce/reduce.sh new file mode 100755 index 00000000..d8df11a5 --- /dev/null +++ b/test/monniaux/csmith/reduce/reduce.sh @@ -0,0 +1,15 @@ +#!/bin/bash +INCLUDE=-I$COMPCERT/test/monniaux/csmith/csmith/include/csmith-2.3.0 +if kvx-cos-gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -o source.gcc.target && kvx-cluster -- source.gcc.target >& source.gcc.log +then + if $COMPCERT/ccomp $INCLUDE -fall -fno-cse -fno-cse2 -fno-cse3 source.c -o source.ccomp.target + then + kvx-cluster -- source.ccomp.target >& source.ccomp.log + grep OPCODE source.ccomp.log + else + exit 2 + fi +else + exit 1 +fi + diff --git a/test/monniaux/csmith/reduce/reduce_wrt_host.sh b/test/monniaux/csmith/reduce/reduce_wrt_host.sh new file mode 100755 index 00000000..6e01f3a0 --- /dev/null +++ b/test/monniaux/csmith/reduce/reduce_wrt_host.sh @@ -0,0 +1,25 @@ +#!/bin/bash +INCLUDE=-I$COMPCERT/test/monniaux/csmith/csmith/include/csmith-2.3.0 +if gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -o source.gcc.host && valgrind --exit-on-first-error=yes --error-exitcode=120 --log-file=valgrind.out ./source.gcc.host > source.gcc.host.out ; +then + if gcc $INCLUDE -Werror=uninitialized -Werror=implicit -fsanitize=undefined -fsanitize=address source.c -o source.gcc+san.host && ./source.gcc+san.host > source.gcc+san.host.out ; + then + if kvx-cos-gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -o source.gcc.target && kvx-cluster -- source.gcc.target >& source.gcc.target.out && cmp source.gcc.host.out source.gcc.target.out + then + if $COMPCERT/ccomp $INCLUDE -fall -fno-cse -fno-cse2 -fno-cse3 source.c -o source.ccomp.target + then + kvx-cluster -- source.ccomp.target >& source.ccomp.target.out + cmp source.ccomp.target.out source.gcc.target.out + else + exit 2 + fi + else + exit 1 + fi + else + exit 4 + fi +else + exit 5 +fi + -- cgit From b2072e4497dbb109d391e89e20c89b87450cf728 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sun, 19 Sep 2021 10:00:49 +0200 Subject: fix script to answer 0 if differences --- test/monniaux/csmith/reduce/reduce_wrt_host.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/monniaux/csmith/reduce/reduce_wrt_host.sh b/test/monniaux/csmith/reduce/reduce_wrt_host.sh index 6e01f3a0..23e4208e 100755 --- a/test/monniaux/csmith/reduce/reduce_wrt_host.sh +++ b/test/monniaux/csmith/reduce/reduce_wrt_host.sh @@ -9,7 +9,10 @@ then if $COMPCERT/ccomp $INCLUDE -fall -fno-cse -fno-cse2 -fno-cse3 source.c -o source.ccomp.target then kvx-cluster -- source.ccomp.target >& source.ccomp.target.out - cmp source.ccomp.target.out source.gcc.target.out + if cmp source.ccomp.target.out source.gcc.target.out + then exit 40 + else exit 0 + fi else exit 2 fi -- cgit From 4a17125ee3f6766710e6e6e47d551cf0cf29cb47 Mon Sep 17 00:00:00 2001 From: Léo Gourdin Date: Sun, 19 Sep 2021 11:41:43 +0200 Subject: fix issue 244 --- test/gourdinl/builtin_memcpy.c | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/gourdinl/builtin_memcpy.c (limited to 'test') diff --git a/test/gourdinl/builtin_memcpy.c b/test/gourdinl/builtin_memcpy.c new file mode 100644 index 00000000..421f543c --- /dev/null +++ b/test/gourdinl/builtin_memcpy.c @@ -0,0 +1,9 @@ +struct a b; +struct a { + short; + int; + short; +} c() { + struct a d[2][16]; + b = d[1][7]; +} -- cgit From 012e76c21d78212f5456611ebb319d39846186c1 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sun, 19 Sep 2021 15:11:24 +0200 Subject: RiscV --- test/monniaux/csmith/reduce/reduce_wrt_host.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/monniaux/csmith/reduce/reduce_wrt_host.sh b/test/monniaux/csmith/reduce/reduce_wrt_host.sh index 23e4208e..a37eb51b 100755 --- a/test/monniaux/csmith/reduce/reduce_wrt_host.sh +++ b/test/monniaux/csmith/reduce/reduce_wrt_host.sh @@ -4,12 +4,12 @@ if gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -o source.gcc.ho then if gcc $INCLUDE -Werror=uninitialized -Werror=implicit -fsanitize=undefined -fsanitize=address source.c -o source.gcc+san.host && ./source.gcc+san.host > source.gcc+san.host.out ; then - if kvx-cos-gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -o source.gcc.target && kvx-cluster -- source.gcc.target >& source.gcc.target.out && cmp source.gcc.host.out source.gcc.target.out + if riscv64-linux-gnu-gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -o source.gcc.target && qemu-riscv64 -L /usr/riscv64-linux-gnu source.gcc.target >& source.gcc.target.out && diff source.gcc.host.out source.gcc.target.out then if $COMPCERT/ccomp $INCLUDE -fall -fno-cse -fno-cse2 -fno-cse3 source.c -o source.ccomp.target then - kvx-cluster -- source.ccomp.target >& source.ccomp.target.out - if cmp source.ccomp.target.out source.gcc.target.out + qemu-riscv64 -L /usr/riscv64-linux-gnu source.ccomp.target >& source.ccomp.target.out + if diff source.ccomp.target.out source.gcc.target.out then exit 40 else exit 0 fi -- cgit From 9861bfb0838fb9fed84a32de67a4c983692b4dcf Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Mon, 20 Sep 2021 07:36:09 +0200 Subject: use clang, better error reporting --- test/monniaux/csmith/reduce/reduce_wrt_host.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/monniaux/csmith/reduce/reduce_wrt_host.sh b/test/monniaux/csmith/reduce/reduce_wrt_host.sh index a37eb51b..698d078d 100755 --- a/test/monniaux/csmith/reduce/reduce_wrt_host.sh +++ b/test/monniaux/csmith/reduce/reduce_wrt_host.sh @@ -1,10 +1,10 @@ #!/bin/bash INCLUDE=-I$COMPCERT/test/monniaux/csmith/csmith/include/csmith-2.3.0 -if gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -o source.gcc.host && valgrind --exit-on-first-error=yes --error-exitcode=120 --log-file=valgrind.out ./source.gcc.host > source.gcc.host.out ; +if /usr/bin/clang $INCLUDE -O -Werror=uninitialized -Werror=implicit -Werror=return-type source.c -o source.clang.host && valgrind --exit-on-first-error=yes --error-exitcode=120 --log-file=valgrind.out ./source.clang.host > source.clang.host.out ; then - if gcc $INCLUDE -Werror=uninitialized -Werror=implicit -fsanitize=undefined -fsanitize=address source.c -o source.gcc+san.host && ./source.gcc+san.host > source.gcc+san.host.out ; + if gcc $INCLUDE -Werror=uninitialized -Werror=implicit -Werror=return-type -fsanitize=undefined -fsanitize=address source.c -o source.gcc+san.host && ./source.gcc+san.host > source.gcc+san.host.out ; then - if riscv64-linux-gnu-gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -o source.gcc.target && qemu-riscv64 -L /usr/riscv64-linux-gnu source.gcc.target >& source.gcc.target.out && diff source.gcc.host.out source.gcc.target.out + if cmp source.clang.host.out source.gcc+san.host.out && riscv64-linux-gnu-gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -Werror=return-type -o source.gcc.target && qemu-riscv64 -L /usr/riscv64-linux-gnu source.gcc.target >& source.gcc.target.out && diff source.clang.host.out source.gcc.target.out then if $COMPCERT/ccomp $INCLUDE -fall -fno-cse -fno-cse2 -fno-cse3 source.c -o source.ccomp.target then -- cgit From 81eadac7dfaa7fb05f11d45042b74e95e1a14a09 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Mon, 20 Sep 2021 13:29:24 +0200 Subject: do 500 of them --- test/monniaux/csmith/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/monniaux/csmith/Makefile b/test/monniaux/csmith/Makefile index ab7931f1..78664c4b 100644 --- a/test/monniaux/csmith/Makefile +++ b/test/monniaux/csmith/Makefile @@ -20,7 +20,7 @@ CSMITH=csmith/bin/csmith endif CSMITHOPT=--max-funcs 10 -MAX=5000 +MAX=500 PREFIX=ran%06.f CCOMPOTS=-static -- cgit From ea881bf4002c6a2ee5cafff393ee0c8939d50835 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Mon, 20 Sep 2021 14:45:49 +0200 Subject: separate wget/curl --- test/monniaux/csmith/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/monniaux/csmith/Makefile b/test/monniaux/csmith/Makefile index ab7931f1..274b3b84 100644 --- a/test/monniaux/csmith/Makefile +++ b/test/monniaux/csmith/Makefile @@ -90,7 +90,9 @@ ran%/example.host_target.cmp : ran%/example.gcc.host.out ran%/example.ccomp.targ clean: -rm -rf ran* -csmith/bin/csmith: - curl -L -o csmith-2.3.0.tar.gz https://embed.cs.utah.edu/csmith/csmith-2.3.0.tar.gz +csmith-2.3.0.tar.gz: + curl -L -O $@ https://embed.cs.utah.edu/csmith/csmith-2.3.0.tar.gz + +csmith/bin/csmith: csmith-2.3.0.tar.gz tar xfz csmith-2.3.0.tar.gz WD=`pwd` && cd csmith-2.3.0 && ./configure --prefix=$$WD/csmith && make install -- cgit From 3a6a2f239aa00fc568d7206909e1ffd9eef1f31c Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Mon, 20 Sep 2021 17:09:23 +0200 Subject: better predicate --- test/monniaux/csmith/reduce/reduce_wrt_host.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/monniaux/csmith/reduce/reduce_wrt_host.sh b/test/monniaux/csmith/reduce/reduce_wrt_host.sh index 698d078d..5e86213e 100755 --- a/test/monniaux/csmith/reduce/reduce_wrt_host.sh +++ b/test/monniaux/csmith/reduce/reduce_wrt_host.sh @@ -1,15 +1,15 @@ #!/bin/bash INCLUDE=-I$COMPCERT/test/monniaux/csmith/csmith/include/csmith-2.3.0 -if /usr/bin/clang $INCLUDE -O -Werror=uninitialized -Werror=implicit -Werror=return-type source.c -o source.clang.host && valgrind --exit-on-first-error=yes --error-exitcode=120 --log-file=valgrind.out ./source.clang.host > source.clang.host.out ; +if /usr/bin/clang $INCLUDE -O -Werror=strict-prototypes -Werror=uninitialized -Werror=implicit -Werror=return-type source.c -o source.clang.host && valgrind --exit-on-first-error=yes --error-exitcode=120 --log-file=valgrind.out ./source.clang.host > source.clang.host.out ; then - if gcc $INCLUDE -Werror=uninitialized -Werror=implicit -Werror=return-type -fsanitize=undefined -fsanitize=address source.c -o source.gcc+san.host && ./source.gcc+san.host > source.gcc+san.host.out ; + if gcc $INCLUDE -Werror=strict-prototypes -Werror=uninitialized -Werror=implicit -Werror=return-type -fsanitize=undefined -fsanitize=address source.c -o source.gcc+san.host && ./source.gcc+san.host > source.gcc+san.host.out ; then - if cmp source.clang.host.out source.gcc+san.host.out && riscv64-linux-gnu-gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -Werror=return-type -o source.gcc.target && qemu-riscv64 -L /usr/riscv64-linux-gnu source.gcc.target >& source.gcc.target.out && diff source.clang.host.out source.gcc.target.out + if cmp source.clang.host.out source.gcc+san.host.out && riscv64-linux-gnu-gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -Werror=return-type -o source.gcc.target && qemu-riscv64 -L /usr/riscv64-linux-gnu source.gcc.target >& source.gcc.target.out && grep checksum source.gcc.target.out && diff source.clang.host.out source.gcc.target.out then if $COMPCERT/ccomp $INCLUDE -fall -fno-cse -fno-cse2 -fno-cse3 source.c -o source.ccomp.target then qemu-riscv64 -L /usr/riscv64-linux-gnu source.ccomp.target >& source.ccomp.target.out - if diff source.ccomp.target.out source.gcc.target.out + if grep checksum source.ccomp.target.out && diff source.ccomp.target.out source.gcc.target.out then exit 40 else exit 0 fi -- cgit From bc0900442d879635ca57bb613fe7644133a63d75 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Mon, 20 Sep 2021 18:56:15 +0200 Subject: keep only checksum --- test/monniaux/csmith/reduce/reduce_wrt_host.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/monniaux/csmith/reduce/reduce_wrt_host.sh b/test/monniaux/csmith/reduce/reduce_wrt_host.sh index 5e86213e..7666c31b 100755 --- a/test/monniaux/csmith/reduce/reduce_wrt_host.sh +++ b/test/monniaux/csmith/reduce/reduce_wrt_host.sh @@ -1,15 +1,15 @@ #!/bin/bash INCLUDE=-I$COMPCERT/test/monniaux/csmith/csmith/include/csmith-2.3.0 -if /usr/bin/clang $INCLUDE -O -Werror=strict-prototypes -Werror=uninitialized -Werror=implicit -Werror=return-type source.c -o source.clang.host && valgrind --exit-on-first-error=yes --error-exitcode=120 --log-file=valgrind.out ./source.clang.host > source.clang.host.out ; +if /usr/bin/clang $INCLUDE -O -Werror=format -Werror=strict-prototypes -Werror=uninitialized -Werror=implicit -Werror=return-type source.c -o source.clang.host && valgrind --exit-on-first-error=yes --error-exitcode=120 --log-file=valgrind.out ./source.clang.host > source.clang.host.out ; then - if gcc $INCLUDE -Werror=strict-prototypes -Werror=uninitialized -Werror=implicit -Werror=return-type -fsanitize=undefined -fsanitize=address source.c -o source.gcc+san.host && ./source.gcc+san.host > source.gcc+san.host.out ; + if gcc $INCLUDE -Werror=format -Werror=strict-prototypes -Werror=uninitialized -Werror=implicit -Werror=return-type -fsanitize=undefined -fsanitize=address source.c -o source.gcc+san.host && ./source.gcc+san.host > source.gcc+san.host.out ; then - if cmp source.clang.host.out source.gcc+san.host.out && riscv64-linux-gnu-gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -Werror=return-type -o source.gcc.target && qemu-riscv64 -L /usr/riscv64-linux-gnu source.gcc.target >& source.gcc.target.out && grep checksum source.gcc.target.out && diff source.clang.host.out source.gcc.target.out + if cmp source.clang.host.out source.gcc+san.host.out && aarch64-linux-gnu-gcc $INCLUDE -Werror=format -Werror=uninitialized -Werror=implicit source.c -Werror=return-type -o source.gcc.target && qemu-aarch64 -L /usr/aarch64-linux-gnu source.gcc.target >& source.gcc.target.out && grep checksum source.gcc.target.out > source.gcc.target.check && diff source.clang.host.out source.gcc.target.out then if $COMPCERT/ccomp $INCLUDE -fall -fno-cse -fno-cse2 -fno-cse3 source.c -o source.ccomp.target then - qemu-riscv64 -L /usr/riscv64-linux-gnu source.ccomp.target >& source.ccomp.target.out - if grep checksum source.ccomp.target.out && diff source.ccomp.target.out source.gcc.target.out + qemu-aarch64 -L /usr/aarch64-linux-gnu source.ccomp.target >& source.ccomp.target.out + if grep checksum source.ccomp.target.out > source.ccomp.target.check && diff source.ccomp.target.check source.gcc.target.check then exit 40 else exit 0 fi -- cgit From ee73aa4d40ac7b57f54321cdec8a8f70633edc81 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Mon, 20 Sep 2021 19:00:50 +0200 Subject: better test --- test/monniaux/csmith/reduce/reduce_wrt_host.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/monniaux/csmith/reduce/reduce_wrt_host.sh b/test/monniaux/csmith/reduce/reduce_wrt_host.sh index 7666c31b..c72ffe30 100755 --- a/test/monniaux/csmith/reduce/reduce_wrt_host.sh +++ b/test/monniaux/csmith/reduce/reduce_wrt_host.sh @@ -9,9 +9,14 @@ then if $COMPCERT/ccomp $INCLUDE -fall -fno-cse -fno-cse2 -fno-cse3 source.c -o source.ccomp.target then qemu-aarch64 -L /usr/aarch64-linux-gnu source.ccomp.target >& source.ccomp.target.out - if grep checksum source.ccomp.target.out > source.ccomp.target.check && diff source.ccomp.target.check source.gcc.target.check - then exit 40 - else exit 0 + if grep checksum source.ccomp.target.out > source.ccomp.target.check + then + if diff source.ccomp.target.check source.gcc.target.check + then exit 40 + else exit 0 + fi + else + exit 50 fi else exit 2 -- cgit From 2fd4ccbcda1494d3af6cbc1a9978ddeb76a8e014 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Mon, 20 Sep 2021 20:38:43 +0200 Subject: don't use unions --- test/monniaux/csmith/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/monniaux/csmith/Makefile b/test/monniaux/csmith/Makefile index 1f32dccb..2e9d9d24 100644 --- a/test/monniaux/csmith/Makefile +++ b/test/monniaux/csmith/Makefile @@ -18,7 +18,7 @@ CFLAGS += -Wno-incompatible-pointer-types ifndef CSMITH CSMITH=csmith/bin/csmith endif -CSMITHOPT=--max-funcs 10 +CSMITHOPT=--max-funcs 10 --no-unions MAX=500 PREFIX=ran%06.f -- cgit From bb85a1c6fee93987bb5cb0948a0d0faa013999fe Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Mon, 20 Sep 2021 21:17:52 +0200 Subject: wrong curl command --- test/monniaux/csmith/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/monniaux/csmith/Makefile b/test/monniaux/csmith/Makefile index 2e9d9d24..5a1d3843 100644 --- a/test/monniaux/csmith/Makefile +++ b/test/monniaux/csmith/Makefile @@ -91,7 +91,7 @@ clean: -rm -rf ran* csmith-2.3.0.tar.gz: - curl -L -O $@ https://embed.cs.utah.edu/csmith/csmith-2.3.0.tar.gz + curl -L -o $@ https://embed.cs.utah.edu/csmith/csmith-2.3.0.tar.gz csmith/bin/csmith: csmith-2.3.0.tar.gz tar xfz csmith-2.3.0.tar.gz -- cgit From 9bfcd959e63b801352d429feca13fc12fff5a809 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Tue, 21 Sep 2021 09:08:08 +0200 Subject: -Werror --- test/monniaux/csmith/reduce/reduce_wrt_host.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/monniaux/csmith/reduce/reduce_wrt_host.sh b/test/monniaux/csmith/reduce/reduce_wrt_host.sh index 7666c31b..039a9c9f 100755 --- a/test/monniaux/csmith/reduce/reduce_wrt_host.sh +++ b/test/monniaux/csmith/reduce/reduce_wrt_host.sh @@ -6,7 +6,7 @@ then then if cmp source.clang.host.out source.gcc+san.host.out && aarch64-linux-gnu-gcc $INCLUDE -Werror=format -Werror=uninitialized -Werror=implicit source.c -Werror=return-type -o source.gcc.target && qemu-aarch64 -L /usr/aarch64-linux-gnu source.gcc.target >& source.gcc.target.out && grep checksum source.gcc.target.out > source.gcc.target.check && diff source.clang.host.out source.gcc.target.out then - if $COMPCERT/ccomp $INCLUDE -fall -fno-cse -fno-cse2 -fno-cse3 source.c -o source.ccomp.target + if $COMPCERT/ccomp $INCLUDE -Werror=missing-declarations -fall -fno-cse -fno-cse2 -fno-cse3 source.c -o source.ccomp.target then qemu-aarch64 -L /usr/aarch64-linux-gnu source.ccomp.target >& source.ccomp.target.out if grep checksum source.ccomp.target.out > source.ccomp.target.check && diff source.ccomp.target.check source.gcc.target.check -- cgit From 296a9f7396784de7e6ce4e4bd7a23bd50454dab1 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Tue, 21 Sep 2021 11:24:48 +0200 Subject: no packed struct --- test/monniaux/csmith/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/monniaux/csmith/Makefile b/test/monniaux/csmith/Makefile index 5a1d3843..1e4b5e5f 100644 --- a/test/monniaux/csmith/Makefile +++ b/test/monniaux/csmith/Makefile @@ -18,7 +18,7 @@ CFLAGS += -Wno-incompatible-pointer-types ifndef CSMITH CSMITH=csmith/bin/csmith endif -CSMITHOPT=--max-funcs 10 --no-unions +CSMITHOPT=--max-funcs 10 --no-packed-struct MAX=500 PREFIX=ran%06.f -- cgit From 9d56918df604aeabe5d42a6fa63b1c85b4e7d840 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Tue, 21 Sep 2021 15:43:44 +0200 Subject: do not allow arbitrary conversions --- test/monniaux/csmith/reduce/reduce_wrt_host.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/monniaux/csmith/reduce/reduce_wrt_host.sh b/test/monniaux/csmith/reduce/reduce_wrt_host.sh index 2cf2102c..f29436f4 100755 --- a/test/monniaux/csmith/reduce/reduce_wrt_host.sh +++ b/test/monniaux/csmith/reduce/reduce_wrt_host.sh @@ -1,14 +1,14 @@ #!/bin/bash INCLUDE=-I$COMPCERT/test/monniaux/csmith/csmith/include/csmith-2.3.0 -if /usr/bin/clang $INCLUDE -O -Werror=format -Werror=strict-prototypes -Werror=uninitialized -Werror=implicit -Werror=return-type source.c -o source.clang.host && valgrind --exit-on-first-error=yes --error-exitcode=120 --log-file=valgrind.out ./source.clang.host > source.clang.host.out ; +if /usr/bin/clang $INCLUDE -O -Werror=int-conversion -Werror=format -Werror=strict-prototypes -Werror=uninitialized -Werror=implicit -Werror=return-type source.c -o source.clang.host && valgrind --exit-on-first-error=yes --error-exitcode=120 --log-file=valgrind.out ./source.clang.host > source.clang.host.out ; then - if gcc $INCLUDE -Werror=format -Werror=strict-prototypes -Werror=uninitialized -Werror=implicit -Werror=return-type -fsanitize=undefined -fsanitize=address source.c -o source.gcc+san.host && ./source.gcc+san.host > source.gcc+san.host.out ; + if gcc $INCLUDE -Werror=int-conversion -Werror=format -Werror=strict-prototypes -Werror=uninitialized -Werror=implicit -Werror=return-type -fsanitize=undefined -fsanitize=address source.c -o source.gcc+san.host && ./source.gcc+san.host > source.gcc+san.host.out ; then - if cmp source.clang.host.out source.gcc+san.host.out && aarch64-linux-gnu-gcc $INCLUDE -Werror=format -Werror=uninitialized -Werror=implicit source.c -Werror=return-type -o source.gcc.target && qemu-aarch64 -L /usr/aarch64-linux-gnu source.gcc.target >& source.gcc.target.out && grep checksum source.gcc.target.out > source.gcc.target.check && diff source.clang.host.out source.gcc.target.out + if cmp source.clang.host.out source.gcc+san.host.out && riscv64-linux-gnu-gcc $INCLUDE -Werror=format -Werror=uninitialized -Werror=implicit source.c -Werror=return-type -o source.gcc.target && qemu-riscv64 -L /usr/riscv64-linux-gnu source.gcc.target >& source.gcc.target.out && grep checksum source.gcc.target.out > source.gcc.target.check && diff source.clang.host.out source.gcc.target.out then if $COMPCERT/ccomp $INCLUDE -Werror=missing-declarations -fall -fno-cse -fno-cse2 -fno-cse3 source.c -o source.ccomp.target then - qemu-aarch64 -L /usr/aarch64-linux-gnu source.ccomp.target >& source.ccomp.target.out + qemu-riscv64 -L /usr/riscv64-linux-gnu source.ccomp.target >& source.ccomp.target.out if grep checksum source.ccomp.target.out > source.ccomp.target.check then if diff source.ccomp.target.check source.gcc.target.check -- cgit From 8b8e019d7086478c633167e47a339d42e12d4f76 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Tue, 21 Sep 2021 17:24:48 +0200 Subject: attempt at printing stuff --- test/monniaux/csmith/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/monniaux/csmith/Makefile b/test/monniaux/csmith/Makefile index 1e4b5e5f..cb5be771 100644 --- a/test/monniaux/csmith/Makefile +++ b/test/monniaux/csmith/Makefile @@ -6,7 +6,7 @@ INCLUDES=-I csmith/include/csmith-2.3.0/ TARGET_CCOMP=../../../ccomp ifndef TARGET_CC -TARGET_CC=gcc +TARGET_CC=gcc # kvx-cos-gcc endif ifndef EXECUTE @@ -23,7 +23,7 @@ CSMITHOPT=--max-funcs 10 --no-packed-struct MAX=500 PREFIX=ran%06.f -CCOMPOTS=-static +# CCOMPOPTS=-Wl,--defsym=USER_STACK_SIZE=0x80000 CCOMPFLAGS+= -fstruct-passing -fbitfields -fno-cse2 -fno-cse -fno-cse3 -stdlib ../../../runtime TESTS_C=$(shell seq --format $(PREFIX)/source.c 1 $(MAX)) @@ -79,10 +79,11 @@ ran%/source.c: mkdir -p ran$* $(CSMITH) $(CSMITHOPT) --seed $* --output ran$*/source.c -ran%/example.target.cmp : ran%/example.gcc.target.out ran%/example.ccomp.target.out +ran%/example.target.cmp : ran%/example.ccomp.target.out ran%/example.gcc.target.out cmp $+ > $@ + cat $< -ran%/example.host_target.cmp : ran%/example.gcc.host.out ran%/example.ccomp.target.out +ran%/example.host_target.cmp : ran%/example.ccomp.target.out ran%/example.gcc.host.out cmp $+ > $@ .PHONY: all clean tests_c tests_c -- cgit From 7fdaf4fc63eb8f6aa70d440c50bcf23782d2cf46 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Tue, 21 Sep 2021 23:07:48 +0200 Subject: grep for ASAN errors --- test/monniaux/csmith/reduce/reduce_wrt_host.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/monniaux/csmith/reduce/reduce_wrt_host.sh b/test/monniaux/csmith/reduce/reduce_wrt_host.sh index f29436f4..ac8433da 100755 --- a/test/monniaux/csmith/reduce/reduce_wrt_host.sh +++ b/test/monniaux/csmith/reduce/reduce_wrt_host.sh @@ -4,6 +4,10 @@ if /usr/bin/clang $INCLUDE -O -Werror=int-conversion -Werror=format -Werror=stri then if gcc $INCLUDE -Werror=int-conversion -Werror=format -Werror=strict-prototypes -Werror=uninitialized -Werror=implicit -Werror=return-type -fsanitize=undefined -fsanitize=address source.c -o source.gcc+san.host && ./source.gcc+san.host > source.gcc+san.host.out ; then + if grep "runtime error" source.gcc+san.out + then + exit 66 + fi if cmp source.clang.host.out source.gcc+san.host.out && riscv64-linux-gnu-gcc $INCLUDE -Werror=format -Werror=uninitialized -Werror=implicit source.c -Werror=return-type -o source.gcc.target && qemu-riscv64 -L /usr/riscv64-linux-gnu source.gcc.target >& source.gcc.target.out && grep checksum source.gcc.target.out > source.gcc.target.check && diff source.clang.host.out source.gcc.target.out then if $COMPCERT/ccomp $INCLUDE -Werror=missing-declarations -fall -fno-cse -fno-cse2 -fno-cse3 source.c -o source.ccomp.target @@ -11,12 +15,12 @@ then qemu-riscv64 -L /usr/riscv64-linux-gnu source.ccomp.target >& source.ccomp.target.out if grep checksum source.ccomp.target.out > source.ccomp.target.check then - if diff source.ccomp.target.check source.gcc.target.check - then exit 40 - else exit 0 - fi + if diff source.ccomp.target.check source.gcc.target.check + then exit 40 + else exit 0 + fi else - exit 50 + exit 50 fi else exit 2 -- cgit From b62d224c49491dfb77a187303c42347bdebd2090 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Tue, 21 Sep 2021 23:09:22 +0200 Subject: fix typo --- test/monniaux/csmith/reduce/reduce_wrt_host.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/monniaux/csmith/reduce/reduce_wrt_host.sh b/test/monniaux/csmith/reduce/reduce_wrt_host.sh index ac8433da..7a11596f 100755 --- a/test/monniaux/csmith/reduce/reduce_wrt_host.sh +++ b/test/monniaux/csmith/reduce/reduce_wrt_host.sh @@ -4,7 +4,7 @@ if /usr/bin/clang $INCLUDE -O -Werror=int-conversion -Werror=format -Werror=stri then if gcc $INCLUDE -Werror=int-conversion -Werror=format -Werror=strict-prototypes -Werror=uninitialized -Werror=implicit -Werror=return-type -fsanitize=undefined -fsanitize=address source.c -o source.gcc+san.host && ./source.gcc+san.host > source.gcc+san.host.out ; then - if grep "runtime error" source.gcc+san.out + if grep "runtime error" source.gcc+san.host.out then exit 66 fi -- cgit From 122397842225e4353e30319e4b1f252dc3e1f41c Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Wed, 22 Sep 2021 09:03:10 +0200 Subject: csmith | creduce breaks on RISC-V 64 --- test/regression/ran000373_reduced.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test/regression/ran000373_reduced.c (limited to 'test') diff --git a/test/regression/ran000373_reduced.c b/test/regression/ran000373_reduced.c new file mode 100644 index 00000000..3f26e88a --- /dev/null +++ b/test/regression/ran000373_reduced.c @@ -0,0 +1,36 @@ +#include +#include +uint32_t au, cc, bk; +union ba { + int64_t bb; +}; +int32_t *ck; +int32_t **cr = &ck; +void a(uint32_t c, int d) { printf("checksum = %X\n", c); } +void av(uint8_t b) { au = b; } +void aw(uint64_t ax) { av(ax); } +void ay(uint64_t ax, char *az, int d) { aw(ax); } +static const int32_t df(int64_t, union ba, uint16_t, uint8_t); +const int32_t dh(int32_t, int32_t, uint32_t); +int16_t e(void) { + union ba f = {5}; + int32_t g = 5; + int32_t i[90269]; + uint32_t s = df(dh(0, 0, cc), f, g, 7); + return s; +} +const int32_t df(int64_t j, union ba k, uint16_t l, uint8_t m) { + *ck = k.bb; + return l; +} +const int32_t dh(int32_t n, int32_t o, uint32_t p) { + int32_t *t = &bk; + uint64_t q = 3; + *cr = t; + return q; +} +int main(void) { + int r = e(); + ay(bk, "", r); + a(au, r); +} -- cgit From abc40ad14d783f139df6e158b0614db9d2292377 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Thu, 23 Sep 2021 05:30:11 +0200 Subject: try with even more stack --- test/monniaux/csmith/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/monniaux/csmith/Makefile b/test/monniaux/csmith/Makefile index cb5be771..e97f43a2 100644 --- a/test/monniaux/csmith/Makefile +++ b/test/monniaux/csmith/Makefile @@ -6,7 +6,7 @@ INCLUDES=-I csmith/include/csmith-2.3.0/ TARGET_CCOMP=../../../ccomp ifndef TARGET_CC -TARGET_CC=gcc # kvx-cos-gcc +TARGET_CC=kvx-cos-gcc endif ifndef EXECUTE -- cgit From 2789e6179af061381f5b18a268adb562b28bcb8e Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Thu, 23 Sep 2021 14:26:26 +0200 Subject: fix for running x86-64 --- test/monniaux/csmith/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/monniaux/csmith/Makefile b/test/monniaux/csmith/Makefile index e97f43a2..1412921d 100644 --- a/test/monniaux/csmith/Makefile +++ b/test/monniaux/csmith/Makefile @@ -6,11 +6,11 @@ INCLUDES=-I csmith/include/csmith-2.3.0/ TARGET_CCOMP=../../../ccomp ifndef TARGET_CC -TARGET_CC=kvx-cos-gcc +TARGET_CC=gcc endif ifndef EXECUTE -EXECUTE=timeout 10s kvx-cluster -- +EXECUTE=timeout 10s endif CFLAGS += -Wno-incompatible-pointer-types -- cgit