1 ; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
2 ; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
5 ; After the rewritable callsite collection if any callsite was found
6 ; in a block that was reported unreachable by DominanceTree then
7 ; removeUnreachableBlocks() was called. But it is stronger than
8 ; DominatorTree::isReachableFromEntry(), i.e. removeUnreachableBlocks
9 ; can remove some blocks for which isReachableFromEntry() returns true.
10 ; This resulted in stale pointers to the collected but removed
11 ; callsites. Such stale pointers caused crash when accessed.
12 declare void @f(i8 addrspace(1)* %obj)
14 define void @test(i8 addrspace(1)* %arg) gc "statepoint-example" {
17 call void @f(i8 addrspace(1)* %arg) #1
18 br i1 true, label %not_zero, label %zero
23 ; This block is reachable but removed by removeUnreachableBlocks()
26 call void @f(i8 addrspace(1)* %arg) #1
30 call void @f(i8 addrspace(1)* %arg) #1
34 attributes #1 = { norecurse noimplicitfloat }