From fa2bdd711212ba6b7a94a20971e8bfa281e73296 Mon Sep 17 00:00:00 2001 From: Uneven Prankster Date: Wed, 12 Jul 2023 13:22:29 -0300 Subject: lol --- tinycc/tests/boundtest.c | 309 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 309 insertions(+) create mode 100644 tinycc/tests/boundtest.c (limited to 'tinycc/tests/boundtest.c') diff --git a/tinycc/tests/boundtest.c b/tinycc/tests/boundtest.c new file mode 100644 index 0000000..e4b2ab1 --- /dev/null +++ b/tinycc/tests/boundtest.c @@ -0,0 +1,309 @@ +#include +#include +#include + +#define NB_ITS 1000000 +//#define NB_ITS 1 +#define TAB_SIZE 100 + +int tab[TAB_SIZE]; +int ret_sum; +char tab3[256]; + +int test1(void) +{ + int i, sum = 0; + for(i=0;i= 2) + index = atoi(argv[1]) - 1; + + if ((index < 0) || (index >= index_max)) { + printf("N is outside of the valid range (%d)\n", index); + exit(2); + } + + /* well, we also use bounds on this ! */ + ftest = table_test[index]; + ftest(); + + return 0; +} + +/* + * without bound 0.77 s + * with bounds 4.73 + */ -- cgit v1.2.3