diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/monniaux/csmith/reduce/reduce_wrt_host.sh | 22 | ||||
-rw-r--r-- | test/regression/ran000373_reduced.c | 36 |
2 files changed, 49 insertions, 9 deletions
diff --git a/test/monniaux/csmith/reduce/reduce_wrt_host.sh b/test/monniaux/csmith/reduce/reduce_wrt_host.sh index 2cf2102c..7a11596f 100755 --- a/test/monniaux/csmith/reduce/reduce_wrt_host.sh +++ b/test/monniaux/csmith/reduce/reduce_wrt_host.sh @@ -1,22 +1,26 @@ #!/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 grep "runtime error" source.gcc+san.host.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 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 - 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 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 <stdint.h> +#include <stdio.h> +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); +} |