Revert "Disable InstCombine unsafe folding bitcasts of calls w/ varargs."

This reverts commit d0e277d272.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149647 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach
2012-02-03 00:00:50 +00:00
parent 478a8a02bc
commit d5917f0b4d
3 changed files with 51 additions and 5 deletions

View File

@@ -30,6 +30,20 @@ define i32 @test2(i32 %A) {
}
; Resolving this should insert a cast from sbyte to int, following the C
; promotion rules.
define void @test3a(i8, ...) {unreachable }
define void @test3(i8 %A, i8 %B) {
call void bitcast (void (i8, ...)* @test3a to void (i8, i8)*)( i8 %A, i8 %B
)
ret void
; CHECK: %1 = zext i8 %B to i32
; CHECK: call void (i8, ...)* @test3a(i8 %A, i32 %1)
; CHECK: ret void
}
; test conversion of return value...
define i8 @test4a() {
ret i8 0