diff options
| author | Philip Reames <listmail@philipreames.com> | 2014-12-04 19:13:45 +0000 |
|---|---|---|
| committer | Philip Reames <listmail@philipreames.com> | 2014-12-04 19:13:45 +0000 |
| commit | 5b3ce71b62cbf9ff1ca1f77504c69e2c0c38ac07 (patch) | |
| tree | daa020fb8560d9e541b2de52675763586a8f180f /llvm/test/Transforms | |
| parent | 2e644415ba3da624f289411612687efd4ce507c6 (diff) | |
| download | bcm5719-llvm-5b3ce71b62cbf9ff1ca1f77504c69e2c0c38ac07.tar.gz bcm5719-llvm-5b3ce71b62cbf9ff1ca1f77504c69e2c0c38ac07.zip | |
Add a test case for argument type coercion in an invoke of a vararg function
This would have caught the bug I fixed in 223370.
llvm-svn: 223378
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/cast.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/cast.ll b/llvm/test/Transforms/InstCombine/cast.ll index a6865557409..aac7a531b35 100644 --- a/llvm/test/Transforms/InstCombine/cast.ll +++ b/llvm/test/Transforms/InstCombine/cast.ll @@ -99,6 +99,26 @@ define void @test11(i32* %P) { ; CHECK: ret void } +declare i32 @__gxx_personality_v0(...) +define void @test_invoke_vararg_cast(i32* %a, i32* %b) { +entry: + %0 = bitcast i32* %b to i8* + %1 = bitcast i32* %a to i64* + invoke void (i32, ...)* @varargs(i32 1, i8* %0, i64* %1) + to label %invoke.cont unwind label %lpad + +invoke.cont: ; preds = %entry + ret void + +lpad: ; preds = %entry + %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + cleanup + ret void +; CHECK-LABEL: test_invoke_vararg_cast +; CHECK-LABEL: entry: +; CHECK: invoke void (i32, ...)* @varargs(i32 1, i32* %b, i32* %a) +} + define i8* @test13(i64 %A) { %c = getelementptr [0 x i8]* bitcast ([32832 x i8]* @inbuf to [0 x i8]*), i64 0, i64 %A ; <i8*> [#uses=1] ret i8* %c |

