forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added HOST_ARCH to Makefile.config.in The HOST_ARCH will be used by MCJIT tests filter, because MCJIT supported only x86 and ARM architectures now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157015 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Danil Malyshev
committed
May 17, 2012
1 parent
9133783
commit bb8cef5
Showing
54 changed files
with
1,295 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
; RUN: %lli -use-mcjit %s > /dev/null | ||
|
||
@.LC0 = internal global [10 x i8] c"argc: %d\0A\00" ; <[10 x i8]*> [#uses=1] | ||
|
||
declare i32 @puts(i8*) | ||
|
||
define void @getoptions(i32* %argc) { | ||
bb0: | ||
ret void | ||
} | ||
|
||
declare i32 @printf(i8*, ...) | ||
|
||
define i32 @main(i32 %argc, i8** %argv) { | ||
bb0: | ||
call i32 (i8*, ...)* @printf( i8* getelementptr ([10 x i8]* @.LC0, i64 0, i64 0), i32 %argc ) ; <i32>:0 [#uses=0] | ||
%cast224 = bitcast i8** %argv to i8* ; <i8*> [#uses=1] | ||
%local = alloca i8* ; <i8**> [#uses=3] | ||
store i8* %cast224, i8** %local | ||
%cond226 = icmp sle i32 %argc, 0 ; <i1> [#uses=1] | ||
br i1 %cond226, label %bb3, label %bb2 | ||
bb2: ; preds = %bb2, %bb0 | ||
%cann-indvar = phi i32 [ 0, %bb0 ], [ %add1-indvar, %bb2 ] ; <i32> [#uses=2] | ||
%add1-indvar = add i32 %cann-indvar, 1 ; <i32> [#uses=2] | ||
%cann-indvar-idxcast = sext i32 %cann-indvar to i64 ; <i64> [#uses=1] | ||
%CT = bitcast i8** %local to i8*** ; <i8***> [#uses=1] | ||
%reg115 = load i8*** %CT ; <i8**> [#uses=1] | ||
%cast235 = getelementptr i8** %reg115, i64 %cann-indvar-idxcast ; <i8**> [#uses=1] | ||
%reg117 = load i8** %cast235 ; <i8*> [#uses=1] | ||
%reg236 = call i32 @puts( i8* %reg117 ) ; <i32> [#uses=0] | ||
%cond239 = icmp slt i32 %add1-indvar, %argc ; <i1> [#uses=1] | ||
br i1 %cond239, label %bb2, label %bb3 | ||
bb3: ; preds = %bb2, %bb0 | ||
%cast243 = bitcast i8** %local to i32* ; <i32*> [#uses=1] | ||
call void @getoptions( i32* %cast243 ) | ||
ret i32 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
; RUN: %lli -use-mcjit %s > /dev/null | ||
|
||
define i32 @foo(i32 %X, i32 %Y, double %A) { | ||
%cond212 = fcmp une double %A, 1.000000e+00 ; <i1> [#uses=1] | ||
%cast110 = zext i1 %cond212 to i32 ; <i32> [#uses=1] | ||
ret i32 %cast110 | ||
} | ||
|
||
define i32 @main() { | ||
%reg212 = call i32 @foo( i32 0, i32 1, double 1.000000e+00 ) ; <i32> [#uses=1] | ||
ret i32 %reg212 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
; RUN: %lli -use-mcjit %s > /dev/null | ||
|
||
define i32 @main() { | ||
call i32 @mylog( i32 4 ) ; <i32>:1 [#uses=0] | ||
ret i32 0 | ||
} | ||
|
||
define internal i32 @mylog(i32 %num) { | ||
bb0: | ||
br label %bb2 | ||
bb2: ; preds = %bb2, %bb0 | ||
%reg112 = phi i32 [ 10, %bb2 ], [ 1, %bb0 ] ; <i32> [#uses=1] | ||
%cann-indvar = phi i32 [ %cann-indvar, %bb2 ], [ 0, %bb0 ] ; <i32> [#uses=1] | ||
%reg114 = add i32 %reg112, 1 ; <i32> [#uses=2] | ||
%cond222 = icmp slt i32 %reg114, %num ; <i1> [#uses=1] | ||
br i1 %cond222, label %bb2, label %bb3 | ||
bb3: ; preds = %bb2 | ||
ret i32 %reg114 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
; RUN: %lli -use-mcjit %s > /dev/null | ||
|
||
define i32 @main() { | ||
; <label>:0 | ||
br label %Loop | ||
Loop: ; preds = %Loop, %0 | ||
%X = phi i32 [ 0, %0 ], [ 1, %Loop ] ; <i32> [#uses=1] | ||
br i1 true, label %Out, label %Loop | ||
Out: ; preds = %Loop | ||
ret i32 %X | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; RUN: %lli -use-mcjit %s > /dev/null | ||
|
||
; We were accidentally inverting the signedness of right shifts. Whoops. | ||
|
||
define i32 @main() { | ||
%X = ashr i32 -1, 16 ; <i32> [#uses=1] | ||
%Y = ashr i32 %X, 16 ; <i32> [#uses=1] | ||
%Z = add i32 %Y, 1 ; <i32> [#uses=1] | ||
ret i32 %Z | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; RUN: %lli -use-mcjit %s > /dev/null | ||
|
||
define i32 @main() { | ||
%X = fadd double 0.000000e+00, 1.000000e+00 ; <double> [#uses=1] | ||
%Y = fsub double 0.000000e+00, 1.000000e+00 ; <double> [#uses=2] | ||
%Z = fcmp oeq double %X, %Y ; <i1> [#uses=0] | ||
fadd double %Y, 0.000000e+00 ; <double>:1 [#uses=0] | ||
ret i32 0 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
; RUN: %lli -use-mcjit %s > /dev/null | ||
|
||
define i32 @bar(i8* %X) { | ||
; pointer should be 4 byte aligned! | ||
%P = alloca double ; <double*> [#uses=1] | ||
%R = ptrtoint double* %P to i32 ; <i32> [#uses=1] | ||
%A = and i32 %R, 3 ; <i32> [#uses=1] | ||
ret i32 %A | ||
} | ||
|
||
define i32 @main() { | ||
%SP = alloca i8 ; <i8*> [#uses=1] | ||
%X = add i32 0, 0 ; <i32> [#uses=1] | ||
alloca i8, i32 %X ; <i8*>:1 [#uses=0] | ||
call i32 @bar( i8* %SP ) ; <i32>:2 [#uses=1] | ||
ret i32 %2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
; This testcase should return with an exit code of 1. | ||
; | ||
; RUN: not %lli -use-mcjit %s | ||
|
||
@test = global i64 0 ; <i64*> [#uses=1] | ||
|
||
define internal i64 @test.upgrd.1() { | ||
%tmp.0 = load i64* @test ; <i64> [#uses=1] | ||
%tmp.1 = add i64 %tmp.0, 1 ; <i64> [#uses=1] | ||
ret i64 %tmp.1 | ||
} | ||
|
||
define i32 @main() { | ||
%L = call i64 @test.upgrd.1( ) ; <i64> [#uses=1] | ||
%I = trunc i64 %L to i32 ; <i32> [#uses=1] | ||
ret i32 %I | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; RUN: %lli -use-mcjit %s test | ||
|
||
declare i32 @puts(i8*) | ||
|
||
define i32 @main(i32 %argc.1, i8** %argv.1) { | ||
%tmp.5 = getelementptr i8** %argv.1, i64 1 ; <i8**> [#uses=1] | ||
%tmp.6 = load i8** %tmp.5 ; <i8*> [#uses=1] | ||
%tmp.0 = call i32 @puts( i8* %tmp.6 ) ; <i32> [#uses=0] | ||
ret i32 0 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
; RUN: %lli -use-mcjit %s > /dev/null | ||
|
||
target datalayout = "e-p:32:32" | ||
|
||
define i32 @main() { | ||
entry: | ||
br label %endif | ||
then: ; No predecessors! | ||
br label %endif | ||
endif: ; preds = %then, %entry | ||
%x = phi i32 [ 4, %entry ], [ 27, %then ] ; <i32> [#uses=0] | ||
%result = phi i32 [ 32, %then ], [ 0, %entry ] ; <i32> [#uses=0] | ||
ret i32 0 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
; RUN: %lli -use-mcjit %s > /dev/null | ||
|
||
; Testcase distilled from 256.bzip2. | ||
|
||
target datalayout = "e-p:32:32" | ||
|
||
define i32 @main() { | ||
entry: | ||
br label %loopentry.0 | ||
loopentry.0: ; preds = %loopentry.0, %entry | ||
%h.0 = phi i32 [ %tmp.2, %loopentry.0 ], [ -1, %entry ] ; <i32> [#uses=1] | ||
%tmp.2 = add i32 %h.0, 1 ; <i32> [#uses=3] | ||
%tmp.4 = icmp ne i32 %tmp.2, 0 ; <i1> [#uses=1] | ||
br i1 %tmp.4, label %loopentry.0, label %loopentry.1 | ||
loopentry.1: ; preds = %loopentry.0 | ||
%h.1 = phi i32 [ %tmp.2, %loopentry.0 ] ; <i32> [#uses=1] | ||
ret i32 %h.1 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
; RUN: %lli -use-mcjit %s > /dev/null | ||
|
||
; Testcase distilled from 256.bzip2. | ||
|
||
target datalayout = "e-p:32:32" | ||
|
||
define i32 @main() { | ||
entry: | ||
%X = add i32 1, -1 ; <i32> [#uses=3] | ||
br label %Next | ||
Next: ; preds = %entry | ||
%A = phi i32 [ %X, %entry ] ; <i32> [#uses=0] | ||
%B = phi i32 [ %X, %entry ] ; <i32> [#uses=0] | ||
%C = phi i32 [ %X, %entry ] ; <i32> [#uses=1] | ||
ret i32 %C | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; RUN: %lli -use-mcjit %s > /dev/null | ||
|
||
; This testcase failed to work because two variable sized allocas confused the | ||
; local register allocator. | ||
|
||
define i32 @main(i32 %X) { | ||
%A = alloca i32, i32 %X ; <i32*> [#uses=0] | ||
%B = alloca float, i32 %X ; <float*> [#uses=0] | ||
ret i32 0 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
; RUN: %lli -use-mcjit %s > /dev/null | ||
|
||
; | ||
; Regression Test: EnvironmentTest.ll | ||
; | ||
; Description: | ||
; This is a regression test that verifies that the JIT passes the | ||
; environment to the main() function. | ||
; | ||
|
||
|
||
declare i32 @strlen(i8*) | ||
|
||
define i32 @main(i32 %argc.1, i8** %argv.1, i8** %envp.1) { | ||
%tmp.2 = load i8** %envp.1 ; <i8*> [#uses=1] | ||
%tmp.3 = call i32 @strlen( i8* %tmp.2 ) ; <i32> [#uses=1] | ||
%T = icmp eq i32 %tmp.3, 0 ; <i1> [#uses=1] | ||
%R = zext i1 %T to i32 ; <i32> [#uses=1] | ||
ret i32 %R | ||
} | ||
|
Oops, something went wrong.