forked from ocaml-multicore/multicoretests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlin_tests_dsl.ml
21 lines (19 loc) · 980 Bytes
/
lin_tests_dsl.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module Atomic_spec : Lin.Spec = struct
open Lin (* FIXME add Gen.nat *)
type t = int Atomic.t
let init () = Atomic.make 0
let cleanup _ = ()
let api =
[ val_ "Atomic.get" Atomic.get (t @-> returning int);
val_ "Atomic.set" Atomic.set (t @-> int @-> returning unit);
val_ "Atomic.exchange" Atomic.exchange (t @-> int @-> returning int);
val_ "Atomic.fetch_and_add" Atomic.fetch_and_add (t @-> int @-> returning int);
val_ "Atomic.compare_and_set" Atomic.compare_and_set (t @-> int @-> int @-> returning bool);
val_ "Atomic.incr" Atomic.incr (t @-> returning unit);
val_ "Atomic.decr" Atomic.decr (t @-> returning unit) ]
end
module Lin_atomic_domain = Lin_domain.Make (Atomic_spec)
let () =
QCheck_base_runner.run_tests_main
[ Lin_atomic_domain.lin_test ~count:1000 ~name:"Lin DSL Atomic test with Domain";
]