# Module Test

`module Test: `sig` .. `end``
Test programs for HLVM.

`val fib : `int list -> Hlvm.t list``
Integer Fibonacci benchmark
`val ffib : `float list -> Hlvm.t list``
Float-based Fibonacci benchmark
`val fill : `([> `Array of 'a | `Int ] as 'a) ->       [> `Function of string * (string * 'a) list * [> `Unit ] * Hlvm.Expr.t ] list``
`val sieve : `int list -> Hlvm.t list``
Sieve of Eratosthenes.
`val mandelbrot : `int list -> Hlvm.t list``
Render the Mandelbrot set with inlined complex arithmetic.
`val mandelbrot2 : `int list -> Hlvm.t list``
Render the Mandelbrot set without inlined arithmetic operations on complex numbers as structs.
`val tco : `int -> Hlvm.t list``
Test tail call elimination by passing one function as an argument to another higher-order function that calls it in tail position, mutually recursively.
`val tuples : `Hlvm.t list``
Test HLVM's struct representation of tuples.
`val trig : `Hlvm.t list``
Test the FFI by calling some trig functions from libc.
`val fold : `int list -> Hlvm.t list``
Create and fold over a large array.
`val ty_list : `([> `Reference ] as 'a) ->       [> `Type of string * [> `Struct of 'a list | `Unit ] ] list``
Type of a list.
`val nil : `Hlvm.Expr.t``
`val cons : `Hlvm.Expr.t -> Hlvm.Expr.t -> Hlvm.Expr.t``
`val cond_list : `string -> string -> string -> Hlvm.Expr.t -> Hlvm.Expr.t -> Hlvm.Expr.t``
Pattern match over empty or non-empty list.
`val list_fold_left : `([> `Function of 'a list * 'a | `Reference ] as 'a) ->       'a -> [> `Function of string * (string * 'a) list * 'a * Hlvm.Expr.t ]``
Polymorphic List.fold_left in HLVM.
`val list : `int list -> Hlvm.t list``
Initialize and fold over a long linked list.
`val ty_closure : `([> `Function of 'a list * 'b ] as 'a) -> 'a * 'b -> [> `Struct of 'a list ]``
Type of a closure.
`val apply : `Hlvm.Expr.t * Hlvm.Expr.t -> Hlvm.Expr.t``
Apply a closure.
`val curry : `Hlvm.t list``
Test curried function application with a uniform representation of closure environments.
`val list_filter : `Hlvm.Type.t -> Hlvm.Type.t -> Hlvm.t``
`val list_length : `'a -> Hlvm.t``
`val queens : `int list -> Hlvm.t list``
Solve the n-queens problem using linked lists.
`val gc : `int list ->       [> `Expr of Hlvm.Expr.t        | `Function of            string *            (string *             ([> `Array of 'a               | `Int               | `Reference               | `Struct of                   [> `Array of [> `Struct of [> `Bool | `Reference ] list ]                    | `Bool                    | `Int                    | `Reference ]                   list ]              as 'a))            list *            [> `Array of 'a             | `Bool             | `Int             | `Struct of                 [> `Array of [> `Struct of [> `Bool | `Reference ] list ] | `Int ]                 list             | `Unit ] *            Hlvm.Expr.t        | `Type of string * [> `Int ] ]       list``
Hash table benchmark derived from HLVM's original GC.
`val bubble_sort : `int list ->       [> `Expr of Hlvm.Expr.t        | `Extern of string * [> `Float ] list * [> `Float ]        | `Function of            string * (string * [> `Array of [> `Float ] | `Int ]) list *            [> `Array of [> `Float ] | `Unit ] * Hlvm.Expr.t ]       list``
Bubble sort floating point numbers.
`val threads : `int ->       [> `Expr of Hlvm.Expr.t        | `Function of            string * (string * [> `Int | `Struct of [> `Int ] list ]) list *            [> `Unit ] * Hlvm.Expr.t ]       list``
Solve the 8-queens problems "n" times in parallel.
`val atomic : `[> `Expr of Hlvm.Expr.t        | `Function of            string *            (string * [> `Struct of [> `Array of [> `Int ] | `Int ] list ]) list *            [> `Unit ] * Hlvm.Expr.t ]       list``
Increment an atomic counter from two threads simultaneously.