summary refs log tree commit diff
path: root/lisc
diff options
context:
space:
mode:
Diffstat (limited to 'lisc')
-rw-r--r--lisc/tools/abi.ml30
1 files changed, 30 insertions, 0 deletions
diff --git a/lisc/tools/abi.ml b/lisc/tools/abi.ml
new file mode 100644
index 0000000..0427454
--- /dev/null
+++ b/lisc/tools/abi.ml
@@ -0,0 +1,30 @@
+(* fuzzer *)
+
+module R = Random
+
+let maxargs = 10
+let maxmems = 16
+
+type _ basety =
+  | Char: int basety
+  | Short: int basety
+  | Int: int basety
+  | Long: int basety
+  | Float: float basety
+  | Double: float basety
+
+type _ structy =
+  | Field: 'a basety * 'b structy -> ('a * 'b) structy
+  | Empty: unit structy
+
+type _ abity =
+  | Base: 'a basety -> 'a abity
+  | Struct: 'a structy -> 'a abity
+
+let _ =
+  let f = open_in "/dev/urandom" in
+  let s = Char.code (input_char f) in
+  let s = Char.code (input_char f) + (s lsl 8) in
+  R.init s;
+  Printf.printf "Seed: %d\n" s;
+  ()