llvm-mirror/test
Gordon Henriksen 29fe360b5a Adding ocaml language bindings for the vmcore and bitwriter libraries. These are
built atop the C language bindings, and user programs can link with them as 
such:

  # Bytecode
  ocamlc -cc g++ llvm.cma llvmbitwriter.cma -o example example.ml
  # Native
  ocamlopt -cc g++ llvm.cmxa llvmbitwriter.cmxa -o example.opt example.ml

The vmcore.ml test exercises most/all of the APIs thus far bound. Unfortunately,
they're not yet numerous enough to write hello world. But:

  $ cat example.ml
  (* example.ml *)
  
  open Llvm
  open Llvm_bitwriter
  
  let _ =
    let filename = Sys.argv.(1) in
    let m = create_module filename in
    
    let v = make_int_constant i32_type 42 false in
    let g = define_global "hello_world" v m in
    
    if not (write_bitcode_file m filename) then exit 1;
    
    dispose_module m;

  $ ocamlc -cc g++ llvm.cma llvm_bitwriter.cma -o example example.ml
  File "example.ml", line 11, characters 6-7:
  Warning Y: unused variable g.
  $ ./example example.bc
  $ llvm-dis < example.bc
  ; ModuleID = '<stdin>'
  @hello_world = global i32 42            ; <i32*> [#uses=0]

The ocaml test cases provide effective tests for the C interfaces.

llvm-svn: 42093
2007-09-18 12:49:39 +00:00
..
Analysis Convert tests using "| wc -l | grep ..." to use the count script. 2007-08-15 13:36:28 +00:00
Archive Delete the svn:executable property on these files, which aren't executable. 2007-07-23 19:26:08 +00:00
Assembler Fix PR1645 by resolving forward alias references. 2007-09-10 23:23:53 +00:00
Bindings/Ocaml Adding ocaml language bindings for the vmcore and bitwriter libraries. These are 2007-09-18 12:49:39 +00:00
Bitcode This is the patch to provide clean intrinsic function overloading support in LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future. 2007-08-04 01:51:18 +00:00
BugPoint Convert .cvsignore files 2007-06-29 16:35:07 +00:00
C++Frontend Testcase for PR1634 2007-09-11 00:39:43 +00:00
CFrontend New testcase for PR1662. GCC trees are horrible :( 2007-09-15 05:46:41 +00:00
CodeGen Objective-C was generating EH frame info like this: 2007-09-18 01:47:22 +00:00
DebugInfo For PR1558: 2007-07-17 06:20:38 +00:00
ExecutionEngine Convert .cvsignore files 2007-06-29 16:35:07 +00:00
Feature Change all floating constants that are not exactly 2007-09-05 17:50:36 +00:00
FrontendAda For multipart tests, place the parts with no 2007-07-23 13:41:53 +00:00
FrontendObjC New test. 2007-05-03 00:42:22 +00:00
Integer Change all floating constants that are not exactly 2007-09-05 17:50:36 +00:00
lib Adding ocaml language bindings for the vmcore and bitwriter libraries. These are 2007-09-18 12:49:39 +00:00
Linker Add a test to ensure that obvious link messages are actually produced on 2007-08-16 07:22:43 +00:00
Other New test. 2007-09-10 18:12:52 +00:00
Scripts Add a test script for counting lines. This can be used instead of the 2007-08-10 15:07:05 +00:00
TableGen Convert tests using "| wc -l | grep ..." to use the count script. 2007-08-15 13:36:28 +00:00
Transforms Fix PR1657 2007-09-18 01:54:42 +00:00
Verifier Fix for PR1633: Verifier doesn't fully verify GC intrinsics 2007-09-17 20:30:04 +00:00
Makefile (no commit message) 2007-09-18 12:26:17 +00:00
Makefile.tests Failure.sh is dead, remove it. 2007-04-21 20:46:55 +00:00
TestRunner.sh Avoid an infinite loop when TestRunner.sh is run outside of the test dir. 2007-05-18 02:06:03 +00:00