1; RUN: opt < %s -inline -reassociate -S | FileCheck %s
2
3; This test case exposed a bug in reassociate where EraseInst's
4; removal of a dead call wasn't recognized as changing the IR.
5; So when runOnFunction propagated the "made changes" upwards
6; to the CallGraphSCCPass it signalled that no changes had been
7; 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 the
11; no longer used function 'bar' (due to incorrect reference
12; count in the CallGraph).
13
14define void @foo() {
15; CHECK-LABEL: @foo(
16; CHECK-NEXT:  entry:
17; CHECK-NEXT:    ret void
18entry:
19  call void @bar()
20  ret void
21}
22
23define internal void @bar() noinline nounwind readnone {
24entry:
25  ret void
26}
27
28
29