lli: Switch to using ParseIRFile, for consistency with other LLVM tools.
authorDaniel Dunbar <daniel@zuster.org>
Sat, 13 Nov 2010 00:28:01 +0000 (00:28 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 13 Nov 2010 00:28:01 +0000 (00:28 +0000)
 - Also, switch tests to not using llvm-as. They run 20% faster now, not that it matters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118952 91177308-0d34-0410-b5e6-96231b3b80d8

43 files changed:
test/ExecutionEngine/2002-12-16-ArgTest.ll
test/ExecutionEngine/2003-01-04-ArgumentBug.ll
test/ExecutionEngine/2003-01-04-LoopTest.ll
test/ExecutionEngine/2003-01-04-PhiTest.ll
test/ExecutionEngine/2003-01-09-SARTest.ll
test/ExecutionEngine/2003-01-10-FUCOM.ll
test/ExecutionEngine/2003-01-15-AlignmentTest.ll
test/ExecutionEngine/2003-05-06-LivenessClobber.ll
test/ExecutionEngine/2003-05-07-ArgumentTest.ll
test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll
test/ExecutionEngine/2003-06-04-bzip2-bug.ll
test/ExecutionEngine/2003-06-05-PHIBug.ll
test/ExecutionEngine/2003-08-15-AllocaAssertion.ll
test/ExecutionEngine/2003-08-21-EnvironmentTest.ll
test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll
test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll
test/ExecutionEngine/2005-12-02-TailCallBug.ll
test/ExecutionEngine/2007-12-10-APIntLoadStore.ll
test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll
test/ExecutionEngine/2010-01-15-UndefValue.ll
test/ExecutionEngine/fpbitcast.ll
test/ExecutionEngine/hello.ll
test/ExecutionEngine/hello2.ll
test/ExecutionEngine/simplesttest.ll
test/ExecutionEngine/simpletest.ll
test/ExecutionEngine/stubs.ll
test/ExecutionEngine/test-arith.ll
test/ExecutionEngine/test-branch.ll
test/ExecutionEngine/test-call.ll
test/ExecutionEngine/test-cast.ll
test/ExecutionEngine/test-constantexpr.ll
test/ExecutionEngine/test-fp.ll
test/ExecutionEngine/test-loadstore.ll
test/ExecutionEngine/test-logical.ll
test/ExecutionEngine/test-loop.ll
test/ExecutionEngine/test-malloc.ll
test/ExecutionEngine/test-phi.ll
test/ExecutionEngine/test-ret.ll
test/ExecutionEngine/test-setcond-fp.ll
test/ExecutionEngine/test-setcond-int.ll
test/ExecutionEngine/test-shift.ll
tools/lli/Makefile
tools/lli/lli.cpp

index 455196923e84b657b7c4bfae02bdfa958d9bed3c..eba58ccca423599966aa5c69d548f3f750d70dbc 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 @.LC0 = internal global [10 x i8] c"argc: %d\0A\00"            ; <[10 x i8]*> [#uses=1]
 
index 5d37e96641621a5f33b37ea2a36476b37eca1b12..4cfd1ebb69e299242ff64d3675497ef66f4069e9 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define i32 @foo(i32 %X, i32 %Y, double %A) {
        %cond212 = fcmp une double %A, 1.000000e+00             ; <i1> [#uses=1]
index 653cf79a52a3827112f6a2eb52f93c5956edd66f..668c8fd7ad0c97c3170ca5da22f8ea728772f4a1 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define i32 @main() {
        call i32 @mylog( i32 4 )                ; <i32>:1 [#uses=0]
index b5c9d8132432b60498fac84b56414633310bf58f..2bc70d749f504f723284cddb304234606c2f25c6 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define i32 @main() {
 ; <label>:0
index 81478972d57f795bca566ea37539499ef0ee67ef..560cd3eae9a2604a4adecfc84012304b81454ec5 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 ; We were accidentally inverting the signedness of right shifts.  Whoops.
 
index d996fa53d9c51bd7ec49e6c850b8d3e116e0a0d8..8512f634323f5bf0c161edd883895990e9bae455 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define i32 @main() {
        %X = fadd double 0.000000e+00, 1.000000e+00             ; <double> [#uses=1]
index a55d74df0d444b6bd3893625a00b1fafaff48e16..9df21c1ccd6d779bc9ce1cde940c46f16bffea3a 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define i32 @bar(i8* %X) {
         ; pointer should be 4 byte aligned!
index 57fe95b2d915b38ceaed4d6159fbf0117d440f7b..e670d11d4a1551ddf1556af64f2f6d67766fc02c 100644 (file)
@@ -1,6 +1,6 @@
-; This testcase shoudl return with an exit code of 1.
+; This testcase should return with an exit code of 1.
 ;
-; RUN: llvm-as < %s | not lli
+; RUN: not lli %s
 
 @test = global i64 0           ; <i64*> [#uses=1]
 
index fa15d7110c32c0b46e55d872365f65626d043d5b..baf42e5e83d824da2163ea0291c52b920b9f61e7 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | lli - test
+; RUN: lli %s test
 
 declare i32 @puts(i8*)
 
index 5a13b21b5f49ffbf4d38794f64d8bfd6e1eaec8d..bcdb11468dcaaa520a56ef45d381bf4bf3765aa0 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 target datalayout = "e-p:32:32"
 
index 6e2da70f736bc2a8b9c10734ad5ab8991ef09f91..37dae861c983ba5223da0692dd574d8b2571dbc4 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 ; Testcase distilled from 256.bzip2.
 
index 50b48da494452802c789dc016899f9d969436208..f7bd8b77244f644c91a9b2014fb5283f12be40bb 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 ; Testcase distilled from 256.bzip2.
 
index 6c90b33cb43193553d88f0a5d7848f83c9db4c85..5970628eaedf6ab8b9ebe020e9c774370e45269e 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 ; This testcase failed to work because two variable sized allocas confused the
 ; local register allocator.
index 3a4a4e439fb891ce469fc180cfcc4101b8c1521f..9c8ec1dd9ce540f83d74def35d654127a1e5581d 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 ;
 ; Regression Test: EnvironmentTest.ll
index b165a1cf30e3b059ea0d7229071ec72d672191a9..152482d436d10a8200ff33419dbfa9fb56ed8748 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 ; This testcase exposes a bug in the local register allocator where it runs out
 ; of registers (due to too many overlapping live ranges), but then attempts to
index aa9d7e7d3632be24fe3ea40bd940a6c4877a8885..97e84cd4092c21f922e2f304e2875bc50944dbe0 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 @A = global i32 0              ; <i32*> [#uses=1]
 
index 59a40ae814036348f9decb5549aaf8859908efe6..83236888c645bf2dbf8c94db8364026994d6a71b 100644 (file)
@@ -1,5 +1,5 @@
 ; PR672
-; RUN: llvm-as < %s | lli
+; RUN: lli %s
 
 define i32 @main() {
        %f = bitcast i32 (i32, i32*, i32)* @check_tail to i32*          ; <i32*> [#uses=1]
index f347f5d3572442c3d57628381cddc9231b41701b..c0dc4cf61abb0a3306433c9d59d6d290febf808a 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llvm-as %s -o - | lli -force-interpreter
+; RUN: lli -force-interpreter %s
 ; PR1836
 
 define i32 @main() {
index e7e434f271c6390ea1f5b2e8924a96c6028d5e79..07cc659cd0409b1e637f118f0b6d27eae8814fc4 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli -force-interpreter=true %t.bc | grep 1
+; RUN: lli -force-interpreter=true %s | grep 1
 
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
 target triple = "i686-pc-linux-gnu"
index 33ca63a02050abe4924bf6889cc9da69c6e77c40..6e7a392125e18802be93a9dd55297201e008478a 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli -force-interpreter=true %t.bc
+; RUN: lli -force-interpreter=true %s
 
 define i32 @main() {
        %a = add i32 0, undef
index 34ca129ead6f724b7680a7040eb71fdb5b5d4708..47cbb02db180647f05ac936951f16606e77eaaa9 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as < %s > %t.bc
-; RUN: lli -force-interpreter=true %t.bc | grep 40091eb8
+; RUN: lli -force-interpreter=true %s | grep 40091eb8
 ;
 define i32 @test(double %x) {
 entry:
index fad36ed583610f5ff1a47399464bf7e438ae96e2..0b75c10f354b8e19826f27898e2a4b8721459f1f 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 @.LC0 = internal global [12 x i8] c"Hello World\00"            ; <[12 x i8]*> [#uses=1]
 
index 7ca0d8827d548641ddceb8a47663b482e7563ef2..9f060be1c342d584fd4dff19b9005cedeab12695 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 @X = global i32 7              ; <i32*> [#uses=0]
 @msg = internal global [13 x i8] c"Hello World\0A\00"          ; <[13 x i8]*> [#uses=1]
index 5d9cf767bcb3b45f4b9b594666d19e27b869707b..ad38485d6e02ecdf1e4bab8c82a971d5f2eb69ff 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define i32 @main() {
        ret i32 0
index 53fb79c2c768831d761653f662c8ee020c37f794..68eb7580b4c1b565e9ffddf5e1efd076adafa826 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define i32 @bar() {
        ret i32 0
index 525d135ff45c738adcb6a3d99057cdca0ae596cd..bd9f69adb83389942261a6f38989e4e535ca2677 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | lli -disable-lazy-compilation=false
+; RUN: lli -disable-lazy-compilation=false %s
 
 define i32 @main() nounwind {
 entry:
index 8c51e6b2e22486d2f524a17a841a2645e99e1c82..354ecd24bc83bffcde2484a7d898423592dbab0c 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define i32 @main() {
        %A = add i8 0, 12               ; <i8> [#uses=1]
index dd8db5465f0ba38407f49836e6ac9583246ddc3e..7d4fd5605922dd30403b3c54fbdf35e171aa782e 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 ; test unconditional branch
 define i32 @main() {
index 4464ebd39bffea329bc3ae0fd4454557da69fc0c..27e16f0f34f71456515cd5f95b36ada16df779bc 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 declare void @exit(i32)
 
index 82d4949782a851144f5e53642c67c9801afd77f2..f41448cc60aa62b5ed9a50704b271b924a53a59f 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define i32 @foo() {
        ret i32 0
index cd5c635331d3a8faa9e1e2f72719f8c5052e373e..d6d90e3e1982c1438763f4b44ce5e5467eb5f997 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 ; This tests to make sure that we can evaluate weird constant expressions
 
index 4ebcf6f7aa7c196cd81286f6029ec62ef1a03469..f653660fb83257b3eafa5171bfd0194dce84619c 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define double @test(double* %DP, double %Arg) {
        %D = load double* %DP           ; <double> [#uses=1]
index ba0f0baf8d6df7d47f768e866e96f0d7e16d4804..53155e8ac90a3a18f36046d7c5d2a45180137800 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define void @test(i8* %P, i16* %P.upgrd.1, i32* %P.upgrd.2, i64* %P.upgrd.3) {
        %V = load i8* %P                ; <i8> [#uses=1]
index e560e52d568dbb63a84a7513536887fe93d27990..710763a30bd87dc2d99c79c82f68283305521f5b 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define i32 @main() {
        %A = and i8 4, 8                ; <i8> [#uses=2]
index 7cd69e2943bce7d16bdbad45d00e30f4e8858500..f0e6f7a6f9c115b7733d35a416c9ed78e50aef4f 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define i32 @main() {
 ; <label>:0
index 8f79d974edb538f667ff751efc2efacb03c9ba39..b3400df44092152b269500598e4a0f87f257bdd1 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define i32 @main() {
        %X = malloc i32         ; <i32*> [#uses=1]
index f1aaefa50585bc18794fe325975640659badc583..c5848a8b5cce9368ffc431b4a269e0e8732935f4 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 ; test phi node
 @Y = global i32 6              ; <i32*> [#uses=1]
index eae91f55375254e1e18dca8e88940884e65b8d64..beec3996075133eb2ce2ca6ff333f628c395749e 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 ; test return instructions
 define void @test1() {
index 4264e2c593fc71eeb72e1f8b37006ff0b8d07dbf..d1d6d05b33521aff202e6446ece73e8de5693b96 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 
 define i32 @main() {
index 772f4fa70a4baecc56d617445128e8bd1c0ebfaa..f59d325a5b5912c7ac0f76f7f25d26e246e89f70 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define i32 @main() {
        %int1 = add i32 0, 0            ; <i32> [#uses=6]
index 2791b8534a58513935f1645e9f61df9b4ddc34c7..d0fb90a4275058d08287e65dfc0f0cc354252588 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llvm-as %s -o %t.bc
-; RUN: lli %t.bc > /dev/null
+; RUN: lli %s > /dev/null
 
 define i32 @main() {
        %shamt = add i8 0, 1            ; <i8> [#uses=8]
index 8f6eeed486bb7c3b39904b0575ffa44293446c15..3217d23d317a338f7d96c71f65b18b9776ed263d 100644 (file)
@@ -9,7 +9,7 @@
 
 LEVEL    := ../..
 TOOLNAME := lli
-LINK_COMPONENTS := jit interpreter nativecodegen bitreader selectiondag
+LINK_COMPONENTS := jit interpreter nativecodegen bitreader asmparser selectiondag
 
 # Enable JIT support
 include $(LEVEL)/Makefile.common
index adc6e90eb99a9c02fd492da28c3be3a463f2990d..fa2de760627d764e2d0073ddd285c23e59d3eae6 100644 (file)
@@ -24,6 +24,7 @@
 #include "llvm/ExecutionEngine/JIT.h"
 #include "llvm/ExecutionEngine/JITEventListener.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/IRReader.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/PluginLoader.h"
@@ -136,20 +137,15 @@ int main(int argc, char **argv, char * const *envp) {
     sys::Process::PreventCoreFiles();
   
   // Load the bitcode...
-  std::string ErrorMsg;
-  Module *Mod = NULL;
-  if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFile,&ErrorMsg)){
-    Mod = getLazyBitcodeModule(Buffer, Context, &ErrorMsg);
-    if (!Mod) delete Buffer;
-  }
-  
+  SMDiagnostic Err;
+  Module *Mod = ParseIRFile(InputFile, Err, Context);
   if (!Mod) {
-    errs() << argv[0] << ": error loading program '" << InputFile << "': "
-           << ErrorMsg << "\n";
-    exit(1);
+    Err.Print(argv[0], errs());
+    return 1;
   }
 
   // If not jitting lazily, load the whole bitcode file eagerly too.
+  std::string ErrorMsg;
   if (NoLazyCompilation) {
     if (Mod->MaterializeAllPermanently(&ErrorMsg)) {
       errs() << argv[0] << ": bitcode didn't read correctly.\n";