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/regression/Makefile | 2 +- test/regression/Results/many_parameters | 1 + test/regression/many_parameters.c | 313 ++++++++++++++++++++++++++++++++ 3 files changed, 315 insertions(+), 1 deletion(-) create mode 100644 test/regression/Results/many_parameters create mode 100644 test/regression/many_parameters.c (limited to 'test/regression') 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 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/regression') 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