aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine/call.ll
diff options
context:
space:
mode:
authorEdward O'Callaghan <eocallaghan@auroraux.org>2009-10-12 08:46:47 +0000
committerEdward O'Callaghan <eocallaghan@auroraux.org>2009-10-12 08:46:47 +0000
commit5464547c02ef34cdfa942b8993997415460cfb90 (patch)
treef6f6c37ae2dea7cda0ca3d440bd64c4e15365b39 /test/Transforms/InstCombine/call.ll
parent7aeb9b5e4ca94fe15d476c3b417b29bef7298932 (diff)
downloadexternal_llvm-5464547c02ef34cdfa942b8993997415460cfb90.zip
external_llvm-5464547c02ef34cdfa942b8993997415460cfb90.tar.gz
external_llvm-5464547c02ef34cdfa942b8993997415460cfb90.tar.bz2
Convert InstCombine/call.ll to CheckFile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83833 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/call.ll')
-rw-r--r--test/Transforms/InstCombine/call.ll25
1 files changed, 22 insertions, 3 deletions
diff --git a/test/Transforms/InstCombine/call.ll b/test/Transforms/InstCombine/call.ll
index 393a567..8d23b70 100644
--- a/test/Transforms/InstCombine/call.ll
+++ b/test/Transforms/InstCombine/call.ll
@@ -1,7 +1,5 @@
; Ignore stderr, we expect warnings there
-; RUN: opt < %s -instcombine 2> /dev/null -S | \
-; RUN: grep call | notcast
-; END.
+; RUN: opt < %s -instcombine 2> /dev/null -S | CheckFile %s
; Simple case, argument translatable without changing the value
@@ -10,17 +8,24 @@ declare void @test1a(i8*)
define void @test1(i32* %A) {
call void bitcast (void (i8*)* @test1a to void (i32*)*)( i32* %A )
ret void
+; CHECK: %tmp = bitcast i32* %A to i8*
+; CHECK: call void @test1a(i8* %tmp)
+; CHECK: ret void
}
; More complex case, translate argument because of resolution. This is safe
; because we have the body of the function
define void @test2a(i8 %A) {
ret void
+; CHECK: ret void
}
define i32 @test2(i32 %A) {
call void bitcast (void (i8)* @test2a to void (i32)*)( i32 %A )
ret i32 %A
+; CHECK: %tmp = trunc i32 %A to i8
+; CHECK: call void @test2a(i8 %tmp)
+; CHECK: ret i32 %A
}
@@ -32,17 +37,24 @@ define void @test3(i8 %A, i8 %B) {
call void bitcast (void (i8, ...)* @test3a to void (i8, i8)*)( i8 %A, i8 %B
)
ret void
+; CHECK: %tmp = zext i8 %B to i32
+; CHECK: call void (i8, ...)* @test3a(i8 %A, i32 %tmp)
+; CHECK: ret void
}
; test conversion of return value...
define i8 @test4a() {
ret i8 0
+; CHECK: ret i8 0
}
define i32 @test4() {
%X = call i32 bitcast (i8 ()* @test4a to i32 ()*)( ) ; <i32> [#uses=1]
ret i32 %X
+; CHECK: %X1 = call i8 @test4a()
+%tmp = zext i8 %X1 to i32
+ret i32 %tmp
}
@@ -53,6 +65,8 @@ declare i32 @test5a()
define i32 @test5() {
%X = call i32 @test5a( ) ; <i32> [#uses=1]
ret i32 %X
+; CHECK: %X = call i32 @test5a()
+; CHECK: ret i32 %X
}
@@ -62,17 +76,22 @@ declare i32 @test6a(i32)
define i32 @test6() {
%X = call i32 bitcast (i32 (i32)* @test6a to i32 ()*)( ) ; <i32> [#uses=1]
ret i32 %X
+; CHECK: %X1 = call i32 @test6a(i32 0)
+; CHECK: ret i32 %X1
}
; test removal of arguments, only can happen with a function body
define void @test7a() {
ret void
+; CHECK: ret void
}
define void @test7() {
call void bitcast (void ()* @test7a to void (i32)*)( i32 5 )
ret void
+; CHECK: call void @test7a()
+; CHECK: ret void
}