2008-03-01 09:15:35 +00:00
|
|
|
; RUN: llvm-as < %s | opt -globalopt | llvm-dis | \
|
2007-04-15 08:30:33 +00:00
|
|
|
; RUN: grep {call void @Actual}
|
2004-10-10 23:12:33 +00:00
|
|
|
|
|
|
|
; Check that a comparison does not prevent an indirect call from being made
|
|
|
|
; direct. The global will still remain, but indirect call elim is still good.
|
|
|
|
|
2008-03-01 09:15:35 +00:00
|
|
|
@G = internal global void ()* null ; <void ()**> [#uses=2]
|
2004-10-10 23:12:33 +00:00
|
|
|
|
2008-03-01 09:15:35 +00:00
|
|
|
define internal void @Actual() {
|
|
|
|
ret void
|
2004-10-10 23:12:33 +00:00
|
|
|
}
|
|
|
|
|
2008-03-01 09:15:35 +00:00
|
|
|
define void @init() {
|
|
|
|
store void ()* @Actual, void ()** @G
|
|
|
|
ret void
|
2004-10-10 23:12:33 +00:00
|
|
|
}
|
|
|
|
|
2008-03-01 09:15:35 +00:00
|
|
|
define void @doit() {
|
|
|
|
%FP = load void ()** @G ; <void ()*> [#uses=2]
|
|
|
|
%CC = icmp eq void ()* %FP, null ; <i1> [#uses=1]
|
|
|
|
br i1 %CC, label %isNull, label %DoCall
|
|
|
|
|
|
|
|
DoCall: ; preds = %0
|
|
|
|
call void %FP( )
|
|
|
|
ret void
|
|
|
|
|
|
|
|
isNull: ; preds = %0
|
|
|
|
ret void
|
2004-10-10 23:12:33 +00:00
|
|
|
}
|
2008-03-01 09:15:35 +00:00
|
|
|
|