2009-09-11 20:01:28 +02:00
|
|
|
; RUN: opt < %s -globalopt -S | \
|
2007-04-15 10:30:33 +02:00
|
|
|
; RUN: grep {call void @Actual}
|
2004-10-11 01:12:33 +02: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 10:15:35 +01:00
|
|
|
@G = internal global void ()* null ; <void ()**> [#uses=2]
|
2004-10-11 01:12:33 +02:00
|
|
|
|
2008-03-01 10:15:35 +01:00
|
|
|
define internal void @Actual() {
|
|
|
|
ret void
|
2004-10-11 01:12:33 +02:00
|
|
|
}
|
|
|
|
|
2008-03-01 10:15:35 +01:00
|
|
|
define void @init() {
|
|
|
|
store void ()* @Actual, void ()** @G
|
|
|
|
ret void
|
2004-10-11 01:12:33 +02:00
|
|
|
}
|
|
|
|
|
2008-03-01 10:15:35 +01: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-11 01:12:33 +02:00
|
|
|
}
|
2008-03-01 10:15:35 +01:00
|
|
|
|