diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2015-01-21 22:32:04 +0000 | 
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2015-01-21 22:32:04 +0000 | 
| commit | 4c0a6e918a0b53466bf886aab573b999e4c26207 (patch) | |
| tree | c0f82eb7f8a13fe458e583de25cf281cf6715988 /llvm/test/Transforms/InstCombine/call-cast-target.ll | |
| parent | 9da94483395fa1023a577be19811a250666cd7cd (diff) | |
| download | bcm5719-llvm-4c0a6e918a0b53466bf886aab573b999e4c26207.tar.gz bcm5719-llvm-4c0a6e918a0b53466bf886aab573b999e4c26207.zip  | |
InstCombine: Don't strip bitcasts off of callsites marked 'thunk'
The return type of a thunk is meaningless, we just want the arguments
and return value to be forwarded.
llvm-svn: 226708
Diffstat (limited to 'llvm/test/Transforms/InstCombine/call-cast-target.ll')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/call-cast-target.ll | 11 | 
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/call-cast-target.ll b/llvm/test/Transforms/InstCombine/call-cast-target.ll index b82dd99db36..4a5c94961e2 100644 --- a/llvm/test/Transforms/InstCombine/call-cast-target.ll +++ b/llvm/test/Transforms/InstCombine/call-cast-target.ll @@ -61,3 +61,14 @@ entry:    %call = tail call i32 bitcast (i32 (i64)* @fn3 to i32 (i32*)*)(i32* %a)    ret i32 %call  } + +declare i32 @fn4(i32) "thunk" + +define i32 @test4(i32* %a) { +; CHECK-LABEL: @test4 +; CHECK:      %[[call:.*]] = tail call i32 bitcast (i32 (i32)* @fn4 to i32 (i32*)*)(i32* %a) +; CHECK-NEXT: ret i32 %[[call]] +entry: +  %call = tail call i32 bitcast (i32 (i32)* @fn4 to i32 (i32*)*)(i32* %a) +  ret i32 %call +}  | 

