1; RUN: opt < %s -gvn-hoist -S | FileCheck %s
2
3; gvn-hoist shouldn't crash in this case.
4; CHECK-LABEL: @func(i1 %b)
5; CHECK:       entry:
6; CHECK-NEXT:  br i1
7; CHECK:  bb1:
8; CHECK-NEXT:  ret void
9; CHECK:  bb2:
10; CHECK-NEXT:  call
11; CHECK-NEXT:  call
12; CHECK-NEXT:  ret void
13
14define void @v_1_0() #0 {
15entry:
16  ret void
17}
18
19define void @func(i1 %b) {
20entry:
21  br i1 %b, label %bb1, label %bb2
22
23bb1:
24  ret void
25
26bb2:
27  call void @v_1_0()
28  call void @v_1_0()
29  ret void
30}
31
32attributes #0 = { nounwind readonly }
33