llvm-6502/test/Transforms/InstCombine/2003-11-13-ConstExprCastCall.ll
Bill Wendling a6c3112b1f Situations can arise when you have a function called that returns a 'void', but
is bitcast to return a floating point value. The result of the instruction may
not be used by the program afterwards, and LLVM will happily remove all
instructions except the call. But, on some platforms, if a value is returned as
a floating point, it may need to be removed from the stack (like x87). Thus, we
can't get rid of the bitcast even if there isn't a use of the value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51134 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 22:45:20 +00:00

9 lines
254 B
LLVM

; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep call | notcast
declare void @free(i8*)
define void @test(i32* %X) {
call void (...)* bitcast (void (i8*)* @free to void (...)*)( i32* %X ) ; <i32>:1 [#uses=0]
ret void
}