aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine/call.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-24 05:10:56 +0000
committerChris Lattner <sabre@nondot.org>2011-02-24 05:10:56 +0000
commit091b1e3c74fee17e33aa87478ab07bfbba0a2f78 (patch)
tree56b70a4c22cb24916260720809d1e1425a0143a4 /test/Transforms/InstCombine/call.ll
parent7558e2e4153233289bc6841f6a85fd54035f293b (diff)
downloadexternal_llvm-091b1e3c74fee17e33aa87478ab07bfbba0a2f78.zip
external_llvm-091b1e3c74fee17e33aa87478ab07bfbba0a2f78.tar.gz
external_llvm-091b1e3c74fee17e33aa87478ab07bfbba0a2f78.tar.bz2
change instcombine to not turn a call to non-varargs bitcast of
function prototype into a call to a varargs prototype. We do allow the xform if we have a definition, but otherwise we don't want to risk that we're changing the abi in a subtle way. On X86-64, for example, varargs require passing stuff in %al. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126363 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/call.ll')
-rw-r--r--test/Transforms/InstCombine/call.ll16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/Transforms/InstCombine/call.ll b/test/Transforms/InstCombine/call.ll
index c256724..2ef8dc0 100644
--- a/test/Transforms/InstCombine/call.ll
+++ b/test/Transforms/InstCombine/call.ll
@@ -32,7 +32,7 @@ define i32 @test2(i32 %A) {
; Resolving this should insert a cast from sbyte to int, following the C
; promotion rules.
-declare void @test3a(i8, ...)
+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
@@ -116,3 +116,17 @@ try.handler: ; preds = %entry
; CHECK: @test8() {
; CHECK-NEXT: invoke void @test8a()
+
+
+; Don't turn this into a direct call, because test9x is just a prototype and
+; doing so will make it varargs.
+; rdar://9038601
+declare i8* @test9x(i8*, i8*, ...) noredzone
+define i8* @test9(i8* %arg, i8* %tmp3) nounwind ssp noredzone {
+entry:
+ %call = call i8* bitcast (i8* (i8*, i8*, ...)* @test9x to i8* (i8*, i8*)*)(i8* %arg, i8* %tmp3) noredzone
+ ret i8* %call
+; CHECK: @test9(
+; CHECK: call i8* bitcast
+}
+