~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to testsuite/tests/tool-ocaml/lib.ml

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-04-21 21:35:08 UTC
  • mfrom: (1.1.11 upstream) (12.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110421213508-kg34453aqmb0moha
* Fixes related to -output-obj with g++ (in debian/patches):
  - add Declare-primitive-name-table-as-const-char
  - add Avoid-multiple-declarations-in-generated-.c-files-in
  - fix Embed-bytecode-in-C-object-when-using-custom: the closing
    brace for extern "C" { ... } was missing in some cases

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(* file $Id: lib.ml 6190 2004-04-06 09:11:45Z starynke $ *)
 
2
 
 
3
external raise : exn -> 'a = "%raise"
 
4
 
 
5
external not : bool -> bool = "%boolnot"
 
6
 
 
7
external (=) : 'a -> 'a -> bool = "%equal"
 
8
external (<>) : 'a -> 'a -> bool = "%notequal"
 
9
external (<) : 'a -> 'a -> bool = "%lessthan"
 
10
external (>) : 'a -> 'a -> bool = "%greaterthan"
 
11
external (<=) : 'a -> 'a -> bool = "%lessequal"
 
12
external (>=) : 'a -> 'a -> bool = "%greaterequal"
 
13
 
 
14
external (~-) : int -> int = "%negint"
 
15
external (+) : int -> int -> int = "%addint"
 
16
external (-) : int -> int -> int = "%subint"
 
17
external ( * ) : int -> int -> int = "%mulint"
 
18
external (/) : int -> int -> int = "%divint"
 
19
external (mod) : int -> int -> int = "%modint"
 
20
 
 
21
external (land) : int -> int -> int = "%andint"
 
22
external (lor) : int -> int -> int = "%orint"
 
23
external (lxor) : int -> int -> int = "%xorint"
 
24
external (lsl) : int -> int -> int = "%lslint"
 
25
external (lsr) : int -> int -> int = "%lsrint"
 
26
external (asr) : int -> int -> int = "%asrint"
 
27
 
 
28
external ignore : 'a -> unit = "%ignore"
 
29
 
 
30
type 'a ref = { mutable contents: 'a }
 
31
external ref : 'a -> 'a ref = "%makemutable"
 
32
external (!) : 'a ref -> 'a = "%field0"
 
33
external (:=) : 'a ref -> 'a -> unit = "%setfield0"
 
34
external incr : int ref -> unit = "%incr"
 
35
external decr : int ref -> unit = "%decr"
 
36
 
 
37
type 'a option = None | Some of 'a
 
38
 
 
39
type 'a weak_t;;
 
40
external weak_create: int -> 'a weak_t = "caml_weak_create";;
 
41
external weak_set : 'a weak_t -> int -> 'a option -> unit = "caml_weak_set";;
 
42
external weak_get: 'a weak_t -> int -> 'a option = "caml_weak_get";;
 
43
 
 
44
let x = 42;;
 
45
 
 
46
(* eof $Id: lib.ml 6190 2004-04-06 09:11:45Z starynke $ *)