1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

lli: Switch to using ParseIRFile, for consistency with other LLVM tools.

- Also, switch tests to not using llvm-as. They run 20% faster now, not that it matters.

llvm-svn: 118952
This commit is contained in:
Daniel Dunbar 2010-11-13 00:28:01 +00:00
parent a08372d4b4
commit 95f870ece4
43 changed files with 49 additions and 89 deletions

View 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]

View 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]

View 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]

View 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

View 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.

View 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]

View 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!

View 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]

View File

@ -1,4 +1,4 @@
; RUN: llvm-as < %s | lli - test
; RUN: lli %s test
declare i32 @puts(i8*)

View 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"

View 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.

View 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.

View 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.

View 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

View 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

View 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]

View 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]

View File

@ -1,4 +1,4 @@
; RUN: llvm-as %s -o - | lli -force-interpreter
; RUN: lli -force-interpreter %s
; PR1836
define i32 @main() {

View 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"

View 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

View 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:

View 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]

View 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]

View 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

View 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

View 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:

View 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]

View 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() {

View 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)

View 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

View 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

View 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]

View 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]

View 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]

View 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

View 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]

View 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]

View 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() {

View 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() {

View 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]

View 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]

View 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

View 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";