brintos

brintos / llvm-project-archived public Read only

0
0
Text · 744 B · 89efe26 Raw
30 lines · plain
1; RUN: opt < %s -passes=globalopt -S | FileCheck %s2; CHECK: call void @Actual3 4; Check that a comparison does not prevent an indirect call from being made 5; direct.  The global will still remain, but indirect call elim is still good.6 7@G = internal global ptr null              ; <ptr> [#uses=2]8 9define internal void @Actual() {10        ret void11}12 13define void @init() {14        store ptr @Actual, ptr @G15        ret void16}17 18define void @doit() {19        %FP = load ptr, ptr @G         ; <ptr> [#uses=2]20        %CC = icmp eq ptr %FP, null                ; <i1> [#uses=1]21        br i1 %CC, label %isNull, label %DoCall22 23DoCall:         ; preds = %024        call void %FP( )25        ret void26 27isNull:         ; preds = %028        ret void29}30