Commit Graph

51 Commits

Author SHA1 Message Date
Gordon Henriksen 37582f74cd 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
Duncan Sands b063fa59d3 The Ada f-e produces various auxiliary output files
that cannot be suppressed and cannot be redirected:
they are dumped in the current working directory.
When running the testsuite this means that these
files do not end up in the Output directory.  The
best solution I could find is to change directory
into Output before running tests.

llvm-svn: 40437
2007-07-23 15:23:35 +00:00
Duncan Sands 76256a069c Fix typo.
llvm-svn: 37224
2007-05-18 12:13:34 +00:00
Reid Spencer 98f713141a Dan is right, using "string first" would produce false positives. So,
devolve the check to a comparison against each component in the string.
Fortunately there isn't many of them.

llvm-svn: 36376
2007-04-23 21:21:53 +00:00
Reid Spencer d1931feba5 Fix the comparison of language names to accept any characters by using
"string first" instead of "regexp match". This helps C++ tests get executed.

llvm-svn: 36339
2007-04-22 14:14:11 +00:00
Reid Spencer 4a82e5d7b7 Replace llvm_gcc_supports_ada and llvm_gcc_supports_objc with just a single
llvm_gcc_supports function that takes the language as an argument. Base that
function on the new LLVMGCC_LANGS configured variable so that we don't have
to execute feature checks during the test run.

llvm-svn: 36322
2007-04-21 21:45:51 +00:00
Reid Spencer a043ed1fc2 llvm-dg.exp is dead, remove it.
llvm-svn: 36317
2007-04-21 20:48:14 +00:00
Reid Spencer 9e56986407 Add the llvm_supports_target function.
llvm-svn: 36314
2007-04-21 20:40:17 +00:00
Duncan Sands 12347e05f6 Test if the compiler supports Ada, and enable Ada tests if so. While I was
there, delete a temporary file the objc test forgot to delete.

llvm-svn: 36312
2007-04-21 20:20:47 +00:00
Reid Spencer e01dd63b87 Always print the same "PR" information in the same location (just after
the test name) in all cases (PASS, XPASS, FAIL, XFAIL). This makes the
output consistent and more amenable to parsing by nightly test.

llvm-svn: 36311
2007-04-21 18:53:12 +00:00
Reid Spencer c0d770b8a1 Put failure information on a separate line. Hopefully this unbreaks the
nightly tester which expects the FAIL: line to only have the test name on
it.

llvm-svn: 36310
2007-04-21 18:46:52 +00:00
Devang Patel 62cf9a592c Enable Objective-C tests.
llvm-svn: 36281
2007-04-20 21:24:01 +00:00
Duncan Sands 2e1ec4dee3 Spelling fix.
llvm-svn: 36165
2007-04-16 21:19:45 +00:00
Duncan Sands 389439c7c5 Change ne into !=.
llvm-svn: 36135
2007-04-16 15:37:00 +00:00
Reid Spencer 25cdea0579 Two changes:
1. Don't bother truncating reading of the file. It doesn't save that much
   time and we should support putting RUN lines anywhere in the file. For
   example, someone might want to put the grep match before each function
   in the test file which would sprinkle the RUN: lines throughout the file.
2. Fix a bug with llvmgcc version match .. global var wasn't declared as such

llvm-svn: 36085
2007-04-15 20:43:36 +00:00
Reid Spencer d033c77ea3 Some tests have really long RUN line sets. Read the first 4096 bytes instead
of 1024.

llvm-svn: 36083
2007-04-15 20:31:42 +00:00
Reid Spencer 3d18d852d2 Allow lines that have \ and end in \ to be recognized as ending in \
llvm-svn: 36074
2007-04-15 18:38:42 +00:00
Reid Spencer 4faa954403 Two improvements:
1. Only read the first 1024 bytes of the file. The RUN: lines should all be
   within that amount of space.  This keeps I/O costs down when reading
   very large files.
2. Print PR numbers with a PR prefix so it is clear what they are.

llvm-svn: 36071
2007-04-15 10:27:54 +00:00
Reid Spencer 72d6b398e7 No, don't cancel all remaining tests, just the one that failed!
llvm-svn: 36057
2007-04-15 07:34:58 +00:00
Reid Spencer 9de817a471 Abandone the entire test case on the first error.
llvm-svn: 36056
2007-04-15 07:21:26 +00:00
Reid Spencer 9a2319b85e Allow replacement of %% with %
llvm-svn: 36044
2007-04-15 04:57:03 +00:00
Reid Spencer 3fc53d6c53 Changes to fix problems with "make check". Apparently you can redefine
functions and Tcl's just tickled with that. The fix is to give the "new"
test system a different interface function name.

llvm-svn: 36022
2007-04-14 22:51:29 +00:00
Reid Spencer 63338746dd For PR1319:
More improvements:
1. Using ::errorInfo wasn't such a hot idea. Go back to just printing the
   offending line of code and the stderr output. This is sufficient and
   not entangled with Tcl goop.
2. Capture the problem report numbers and report them whether pass or fail.
   This helps quickly get some context when a test fails, if it has an
   associated PR number.

llvm-svn: 36010
2007-04-14 19:37:22 +00:00
Reid Spencer b7c5957e7c 1. Don't generate redundant copy of stderr
2. Only match \ at the *end* of a line.

llvm-svn: 36007
2007-04-14 18:51:19 +00:00
Reid Spencer 6e0ffa8c43 Print full errorInfo when a failure occurs.
llvm-svn: 35999
2007-04-14 17:36:20 +00:00
Reid Spencer 89956dc90f Add the line number where the script failed to the error output.
llvm-svn: 35994
2007-04-14 16:41:39 +00:00
Reid Spencer 155171c566 Initial version of a re-write of llvm-runtest that doesn't write the
tests to a script file but executes each line individually and catches
errors on each line too.

llvm-svn: 35986
2007-04-14 09:39:28 +00:00
Reid Spencer 09f5000873 Make the shlibext and llvmlibsdir variables accessible.
llvm-svn: 35939
2007-04-12 02:49:30 +00:00
Reid Spencer 641527f3e2 Make new variables available: compile_c, compile_cxx, link to handle tests
that want to use LLVM's notion of compiling and linking programs. This
includes all the -I -L and optimization switches that LLVM would using to
compile or link any of this files.

llvm-svn: 35920
2007-04-11 20:57:39 +00:00
Reid Spencer d029c7e666 Make the llvm-runtest function much more amenable by eliminating all the
global variables that needed to be passed in. This makes it possible to
add new global variables with only a couple changes (Makefile and llvm-dg.exp)
instead of touching every single dg.exp file.

llvm-svn: 35918
2007-04-11 19:56:59 +00:00
Reid Spencer 60012ded54 Update the way llvm2cpp tests are done:
1. Make sure bytecode/assembly inputs are always redirected stdin so that
   the module name is <stdin>. This helps not get false negatives when the
   diff is done.
2. Scan the test file to determine if llvm-upgrade needs to be run.
3. Avoid running testings that are XFAIL'd because they'll cause a failure
   when run for llvm2cpp.
4. Get some better error message output.

llvm-svn: 35914
2007-04-11 17:56:23 +00:00
Reid Spencer 569f3913a9 No, libLLVMbzip2 does not have a .a suffix.
llvm-svn: 28624
2006-06-01 07:23:32 +00:00
Reid Spencer d661a4c218 Fix gcc command line options after LLVMCore and LLVMbzip2 became archive
libraries.

llvm-svn: 28623
2006-06-01 07:19:28 +00:00
Reid Spencer b5ddb66ce0 1. No need to thwart this test with an environment variable. Turning it off
is the default and handled by the makefile system and runtest
2. Redirect stderr of llvm-as and llvm2cpp so that warning messages about
   instrinsics don't cause Tcl to report the run as failed.

llvm-svn: 28576
2006-05-30 23:07:17 +00:00
Reid Spencer 131ca2869c Fix a bug with diffing the wrong files. Make output more readable.
llvm-svn: 28542
2006-05-29 18:09:38 +00:00
Reid Spencer 497120ef63 Fix a problem where dejagnu won't accept the value of global tcl variable
"libdir" for some reason. Changing to llvmlibsdir instead fixes it.

llvm-svn: 28526
2006-05-28 07:22:42 +00:00
Reid Spencer 633301acea Provide an infrastructure for testing the llvm2cpp program (yet to be
committed). This infrastructure is only activated when RUNLLVM2CPP=1 is
specified on the make command line. Currently it is only supported in the
Feature test suite.

llvm-svn: 28525
2006-05-28 04:21:40 +00:00
Reid Spencer 8d88fc5ee4 Improve error output. Use the third parameter of the "catch" command to
capture the error output from the exec option. This generally will capture
the stderr messages generated by the tools. This information is then
printed if the test fails. This helps to recognize more quickly what the
error was. Otherwise, this information is lost.

llvm-svn: 28385
2006-05-18 19:42:16 +00:00
Tanya Lattner 27fba1761d Added the ability to xfail based on llvmgcc version
llvm-svn: 27635
2006-04-12 21:57:40 +00:00
Chris Lattner fd9bf36070 Automatically pass -emit-llvm to llvmgcc when using %llvmgcc
llvm-svn: 26623
2006-03-08 22:32:20 +00:00
Tanya Lattner 97b21a06a3 Adding timeout for a test.
llvm-svn: 18372
2004-11-30 06:29:45 +00:00
Tanya Lattner 5615a28d13 Forgot to join srcdir and subdir for complete path for input files.
llvm-svn: 18022
2004-11-19 23:00:19 +00:00
Tanya Lattner 8287d24dd3 Adding srcdir arg. Added ability to specify the path to an input file. This is needed for when srcdir != objdir.
llvm-svn: 18021
2004-11-19 22:46:23 +00:00
Tanya Lattner 0fbc9c8350 setting path to prcontext.tcl script. Right now it searches for tclsh in your path, but this should be obtained from configure.
llvm-svn: 17720
2004-11-13 23:36:18 +00:00
Tanya Lattner 79d046ba70 Run prcontext.tcl with tclsh and let it be found in the path. This should be found by configure.
llvm-svn: 17713
2004-11-13 23:16:17 +00:00
Tanya Lattner bb05cd7f85 Changed to use tcl script.
llvm-svn: 17711
2004-11-13 22:55:51 +00:00
Tanya Lattner 8fabe17ced Now using path to python found by configure.
llvm-svn: 17610
2004-11-08 03:26:59 +00:00
Tanya Lattner 7095a68e49 More srcdir != objdir changes.
llvm-svn: 17596
2004-11-07 23:21:50 +00:00
Tanya Lattner c7392e0662 Made changes to support objdir!=srcdir.
llvm-svn: 17590
2004-11-07 22:04:21 +00:00
Tanya Lattner 3b71027e18 With the changes to these files, the Regression test suite should be tested by dejagnu without anyproblem.
Some variables could be made global.

llvm-svn: 17557
2004-11-07 05:02:56 +00:00