aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-12-20 11:55:50 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-12-20 11:55:50 -0800
commit39a3f9ce401f4506f8b816ed7f0bd023ea5b7ff8 (patch)
tree276e01ccb9129ce6a2e8926f86f7490265eef115
parent2d5f34d1504a3e9c90780efd4194a36da5296718 (diff)
improve fuzz testcase runner
-rw-r--r--tests/fuzz/13.c107
-rw-r--r--tests/fuzz/13.c.txt1
-rwxr-xr-xtests/fuzz/test.sh12
3 files changed, 114 insertions, 6 deletions
diff --git a/tests/fuzz/13.c b/tests/fuzz/13.c
new file mode 100644
index 00000000..623f0dee
--- /dev/null
+++ b/tests/fuzz/13.c
@@ -0,0 +1,107 @@
+/*
+ * This is a RANDOMLY GENERATED PROGRAM.
+ *
+ * Generator: csmith 2.2.0
+ * Git version: bf42ffd
+ * Options: --no-volatiles --no-math64 --no-packed-struct
+ * Seed: 4004715028
+ */
+
+#include "csmith.h"
+
+
+static long __undefined;
+
+/* --- Struct/Union Declarations --- */
+/* --- GLOBAL VARIABLES --- */
+static uint16_t g_2[9][5] = {{1UL,65535UL,0xF90EL,1UL,65532UL},{1UL,1UL,0x4C8DL,1UL,1UL},{65532UL,65535UL,6UL,65529UL,65529UL},{0xF90EL,65532UL,0xF90EL,0x4C8DL,65529UL},{0xC891L,1UL,9UL,1UL,1UL},{65535UL,1UL,0xAA6EL,0xC891L,65532UL},{65526UL,65532UL,9UL,1UL,65535UL},{1UL,0xF90EL,0xF90EL,1UL,65526UL},{1UL,0xC891L,6UL,1UL,0xC891L}};
+
+
+/* --- FORWARD DECLARATIONS --- */
+static uint8_t func_1(void);
+
+
+/* --- FUNCTIONS --- */
+/* ------------------------------------------ */
+/*
+ * reads : g_2
+ * writes:
+ */
+static uint8_t func_1(void)
+{ /* block id: 0 */
+ return g_2[8][2];
+}
+
+
+
+
+/* ---------------------------------------- */
+int main (int argc, char* argv[])
+{
+ int i, j;
+ int print_hash_value = 0;
+ if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1;
+ platform_main_begin();
+ crc32_gentab();
+ func_1();
+ for (i = 0; i < 9; i++)
+ {
+ for (j = 0; j < 5; j++)
+ {
+ transparent_crc(g_2[i][j], "g_2[i][j]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d]\n", i, j);
+
+ }
+ }
+ platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value);
+ return 0;
+}
+
+/************************ statistics *************************
+XXX max struct depth: 0
+breakdown:
+ depth: 0, occurrence: 1
+XXX total union variables: 0
+
+XXX non-zero bitfields defined in structs: 0
+XXX zero bitfields defined in structs: 0
+XXX const bitfields defined in structs: 0
+XXX volatile bitfields defined in structs: 0
+XXX structs with bitfields in the program: 0
+breakdown:
+XXX full-bitfields structs in the program: 0
+breakdown:
+XXX times a bitfields struct's address is taken: 0
+XXX times a bitfields struct on LHS: 0
+XXX times a bitfields struct on RHS: 0
+XXX times a single bitfield on LHS: 0
+XXX times a single bitfield on RHS: 0
+
+XXX max expression depth: 1
+breakdown:
+ depth: 1, occurrence: 1
+
+XXX total number of pointers: 0
+
+XXX times a non-volatile is read: 1
+XXX times a non-volatile is write: 0
+XXX times a volatile is read: 0
+XXX times read thru a pointer: 0
+XXX times a volatile is write: 0
+XXX times written thru a pointer: 0
+XXX times a volatile is available for access: 0
+XXX percentage of non-volatile access: 100
+
+XXX forward jumps: 0
+XXX backward jumps: 0
+
+XXX stmts: 1
+XXX max block depth: 0
+breakdown:
+ depth: 0, occurrence: 1
+
+XXX percentage a fresh-made variable is used: 100
+XXX percentage an existing variable is used: 0
+FYI: the random generator makes assumptions about the integer size. See platform.info for more details.
+********************* end of statistics **********************/
+
diff --git a/tests/fuzz/13.c.txt b/tests/fuzz/13.c.txt
new file mode 100644
index 00000000..696a3908
--- /dev/null
+++ b/tests/fuzz/13.c.txt
@@ -0,0 +1 @@
+checksum = 3F436227
diff --git a/tests/fuzz/test.sh b/tests/fuzz/test.sh
index 99dedd97..768e7ed7 100755
--- a/tests/fuzz/test.sh
+++ b/tests/fuzz/test.sh
@@ -3,18 +3,18 @@
# to find failures, then check those out with this script
echo "0"
-gcc $1 -I/home/alon/Dev/csmith/runtime
-~/Dev/emscripten/emcc $1 -I/home/alon/Dev/csmith/runtime
+gcc $1 -I/home/alon/Dev/csmith/runtime &> /dev/null
+~/Dev/emscripten/emcc $1 -I/home/alon/Dev/csmith/runtime &> /dev/null
./a.out
mozjs a.out.js
echo "1"
-gcc -O1 $1 -I/home/alon/Dev/csmith/runtime
-~/Dev/emscripten/emcc -O1 $1 -I/home/alon/Dev/csmith/runtime
+gcc -O1 $1 -I/home/alon/Dev/csmith/runtime &> /dev/null
+~/Dev/emscripten/emcc -O1 $1 -I/home/alon/Dev/csmith/runtime &> /dev/null
./a.out
mozjs a.out.js
echo "2"
-gcc -O2 $1 -I/home/alon/Dev/csmith/runtime
-~/Dev/emscripten/emcc -O2 -g2 $1 -I/home/alon/Dev/csmith/runtime
+gcc -O2 $1 -I/home/alon/Dev/csmith/runtime &> /dev/null
+~/Dev/emscripten/emcc -O2 $1 -I/home/alon/Dev/csmith/runtime &> /dev/null
./a.out
mozjs a.out.js