30 lines · plain
1; RUN: opt < %s -passes=inline,instcombine -S | FileCheck %s2 3; This test case exposed a bug in instcombine where the early4; DCE of a call wasn't recognized as changing the IR.5; So when runOnFunction propagated the "made changes" upwards6; to the CallGraphSCCPass it signalled that no changes had been7; made, so CallGraphSCCPass assumed that the old CallGraph,8; as known by that pass manager, still was up-to-date.9;10; This was detected as an assert when trying to remove the11; no longer used function 'bar' (due to incorrect reference12; count in the CallGraph).13 14define void @foo() {15; CHECK-LABEL: @foo(16; CHECK-NEXT: entry:17; CHECK-NEXT: ret void18;19entry:20 %call = call i32 @bar()21 ret void22}23 24define internal i32 @bar() {25; CHECK-NOT: bar26entry:27 ret i32 4228}29 30